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

Load power of the PowerStrip fixed and removed from the Plug #117

Merged

Conversation

syssi
Copy link
Collaborator

@syssi 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.

@@ -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']

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.
@syssi syssi force-pushed the feature/powerstrip-power-consume-rate branch from 7da0280 to 44358b7 Compare November 19, 2017 08:21
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"]

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

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

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

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

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

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)

@coveralls
Copy link

coveralls commented Nov 19, 2017

Coverage Status

Coverage increased (+1.09%) to 46.038% when pulling 537b655 on syssi:feature/powerstrip-power-consume-rate into c51e8cc on rytilahti:master.

assert self.state().temperature == \
self.device.start_state["temperature"]
assert self.state().load_power == \
self.device.start_state["power_consume_rate"]

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


assert self.is_on() is True
assert self.state().temperature == \
self.device.start_state["temperature"]

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

assert self.state().temperature == \
self.device.start_state["temperature"]
assert self.state().load_power == \
self.device.start_state["power_consume_rate"]

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


assert self.is_on() is True
assert self.state().temperature == \
self.device.start_state["temperature"]

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

@coveralls
Copy link

coveralls commented Nov 19, 2017

Coverage Status

Coverage increased (+1.09%) to 46.038% when pulling 921bb71 on syssi:feature/powerstrip-power-consume-rate into c51e8cc on rytilahti:master.

@coveralls
Copy link

coveralls commented Nov 19, 2017

Coverage Status

Coverage increased (+1.09%) to 46.038% when pulling 024c147 on syssi:feature/powerstrip-power-consume-rate into c51e8cc on rytilahti:master.

@rytilahti
Copy link
Owner

Yay for coverage increase too, thanks :-)

@rytilahti rytilahti merged commit beeef6a into rytilahti:master Nov 19, 2017
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