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
| def status(self) -> PowerStripStatus: | ||
| """Retrieve properties.""" | ||
| properties = ['power', 'temperature', 'current', 'mode'] | ||
| properties = ['power', 'temperature', 'current', 'mode', 'power_consume_rate'] |
…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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
continuation line over-indented for visual indent
|
Yay for coverage increase too, thanks :-) |