-
-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features of mixed air purifier models added #188
Features of mixed air purifier models added #188
Conversation
assert self.state().sleep_mode_learn_count == self.device.start_state["sleep_data_num"] | ||
assert self.state().extra_features == self.device.start_state["app_extra"] | ||
assert self.state().turbo_mode_supported == (self.device.start_state["app_extra"] == 1) | ||
assert self.state().auto_detect == (self.device.start_state["act_det"] == 'on') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (87 > 79 characters)
assert self.state().sleep_time == self.device.start_state["sleep_time"] | ||
assert self.state().sleep_mode_learn_count == self.device.start_state["sleep_data_num"] | ||
assert self.state().extra_features == self.device.start_state["app_extra"] | ||
assert self.state().turbo_mode_supported == (self.device.start_state["app_extra"] == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (95 > 79 characters)
assert self.state().sleep_mode == OperationMode(self.device.start_state["sleep_mode"]) | ||
assert self.state().sleep_time == self.device.start_state["sleep_time"] | ||
assert self.state().sleep_mode_learn_count == self.device.start_state["sleep_data_num"] | ||
assert self.state().extra_features == self.device.start_state["app_extra"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (82 > 79 characters)
assert self.state().filter_rfid_tag == self.device.start_state["rfid_tag"] | ||
assert self.state().sleep_mode == OperationMode(self.device.start_state["sleep_mode"]) | ||
assert self.state().sleep_time == self.device.start_state["sleep_time"] | ||
assert self.state().sleep_mode_learn_count == self.device.start_state["sleep_data_num"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (95 > 79 characters)
assert self.state().led == (self.device.start_state["led"] == 'on') | ||
assert self.state().led_brightness == LedBrightness(self.device.start_state["led_b"]) | ||
assert self.state().buzzer == (self.device.start_state["buzzer"] == 'on') | ||
assert self.state().child_lock == (self.device.start_state["child_lock"] == 'on') | ||
assert self.state().illuminance == self.device.start_state["bright"] | ||
assert self.state().volume == self.device.start_state["volume"] | ||
assert self.state().filter_rfid_product_id == self.device.start_state["rfid_product_id"] | ||
assert self.state().filter_rfid_tag == self.device.start_state["rfid_tag"] | ||
assert self.state().sleep_mode == OperationMode(self.device.start_state["sleep_mode"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (94 > 79 characters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm wondering whether we should start keeping a list of properties available per device type at some point, to avoid requesting those which cannot be available for the given device type?
Feel free to merge when you want.
miio/airpurifier.py
Outdated
|
||
@property | ||
def turbo_mode_supported(self) -> Optional[bool]: | ||
return self.data["app_extra"] == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return a bool for any value of app_extra
, so no need to mark it Optional here.
miio/airpurifier.py
Outdated
@property | ||
def auto_detect(self) -> Optional[bool]: | ||
"""Return True if auto detect is enabled.""" | ||
return self.data["act_det"] == "on" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here.
miio/airpurifier.py
Outdated
@property | ||
def sleep_mode(self) -> Optional[OperationMode]: | ||
"""Operation mode of the sleep state. (Idle vs. Silent)""" | ||
return OperationMode(self.data["sleep_mode"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's another optional, I'm unsure what happens if the sleep_mode is None, will it just raise an exception or will it return an OperationMode (which one?)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will return "None" now.
No description provided.