Skip to content
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

Merged
merged 4 commits into from Jan 28, 2018

Conversation

syssi
Copy link
Collaborator

@syssi syssi commented Jan 28, 2018

No description provided.

@coveralls
Copy link

coveralls commented Jan 28, 2018

Coverage Status

Coverage increased (+0.7%) to 66.909% when pulling 436abbe on syssi:feature/airpurifier-more-properties into e861c3a on rytilahti:master.

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')

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)

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"]

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"]

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"])

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)

@syssi syssi requested a review from rytilahti January 28, 2018 15:04
Copy link
Owner

@rytilahti rytilahti left a 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.


@property
def turbo_mode_supported(self) -> Optional[bool]:
return self.data["app_extra"] == 1
Copy link
Owner

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.

@property
def auto_detect(self) -> Optional[bool]:
"""Return True if auto detect is enabled."""
return self.data["act_det"] == "on"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here.

@property
def sleep_mode(self) -> Optional[OperationMode]:
"""Operation mode of the sleep state. (Idle vs. Silent)"""
return OperationMode(self.data["sleep_mode"])
Copy link
Owner

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?)?

Copy link
Collaborator Author

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.

@syssi syssi merged commit ae5f4ba into rytilahti:master Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants