-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Load power of the PowerStrip fixed and removed from the Plug #117
Load power of the PowerStrip fixed and removed from the Plug #117
Conversation
syssi
commented
Nov 8, 2017
- Property load_power removed from the plug. It's a feature of the PowerStrip. The Xiaomi plug doesn't provide load.
- Load power workaround of the PowerStrip replaced by a property called "power_consume_rate" which provides the same values as the android app.
miio/powerstrip.py
Outdated
@@ -61,7 +66,7 @@ class PowerStrip(Device): | |||
|
|||
def status(self) -> PowerStripStatus: | |||
"""Retrieve properties.""" | |||
properties = ['power', 'temperature', 'current', 'mode'] | |||
properties = ['power', 'temperature', 'current', 'mode', 'power_consume_rate'] |
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 (86 > 79 characters)
…rStrip. The Xiaomi plug doesn't provide load. Load power workaround of the PowerStrip replaced by a property called "power_consume_rate" which provides the same values as the android app.
7da0280
to
44358b7
Compare
Unittest of the Plug updated.
|
||
assert self.is_on() is True | ||
assert self.state().temperature == self.device.start_state["temperature"] | ||
assert self.state().load_power == self.device.start_state["power_consume_rate"] |
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)
self.device._reset_state() | ||
|
||
assert self.is_on() is True | ||
assert self.state().temperature == self.device.start_state["temperature"] |
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 (81 > 79 characters)
|
||
assert self.is_on() is True | ||
assert self.state().temperature == self.device.start_state["temperature"] | ||
assert self.state().load_power == self.device.start_state["power_consume_rate"] |
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)
self.device._reset_state() | ||
|
||
assert self.is_on() is True | ||
assert self.state().temperature == self.device.start_state["temperature"] |
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 (81 > 79 characters)
|
||
assert self.is_on() is True | ||
assert self.state().temperature == self.device.start_state["temperature"] | ||
assert self.state().load_power == self.device.start_state["power_consume_rate"] |
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)
self.device._reset_state() | ||
|
||
assert self.is_on() is True | ||
assert self.state().temperature == self.device.start_state["temperature"] |
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 (81 > 79 characters)
miio/tests/test_powerstrip.py
Outdated
assert self.state().temperature == \ | ||
self.device.start_state["temperature"] | ||
assert self.state().load_power == \ | ||
self.device.start_state["power_consume_rate"] |
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.
continuation line over-indented for visual indent
miio/tests/test_powerstrip.py
Outdated
|
||
assert self.is_on() is True | ||
assert self.state().temperature == \ | ||
self.device.start_state["temperature"] |
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.
continuation line over-indented for visual indent
miio/tests/test_powerstrip.py
Outdated
assert self.state().temperature == \ | ||
self.device.start_state["temperature"] | ||
assert self.state().load_power == \ | ||
self.device.start_state["power_consume_rate"] |
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.
continuation line over-indented for visual indent
miio/tests/test_powerstrip.py
Outdated
|
||
assert self.is_on() is True | ||
assert self.state().temperature == \ | ||
self.device.start_state["temperature"] |
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.
continuation line over-indented for visual indent
Yay for coverage increase too, thanks :-) |