Skip to content

Add HomematicIP Cloud light power consumption and energie attributes#15343

Merged
MartinHjelmare merged 3 commits intohome-assistant:devfrom
worm-ee:update-homematicip_cloud-lights_power_consumption
Jul 9, 2018
Merged

Add HomematicIP Cloud light power consumption and energie attributes#15343
MartinHjelmare merged 3 commits intohome-assistant:devfrom
worm-ee:update-homematicip_cloud-lights_power_consumption

Conversation

@worm-ee
Copy link
Copy Markdown
Contributor

@worm-ee worm-ee commented Jul 7, 2018

Description:

  • Add power consumption and energy counter attributes to the HomematicIP light.
  • Change instance check to async class version

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

attr = super().device_state_attributes
if self._device.currentPowerConsumption > 0.05:
attr.update({
ATTR_POWER_CONSUMPTION: round(self._device.currentPowerConsumption, 2)
Copy link
Copy Markdown

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)

@worm-ee worm-ee changed the title Add power consumption and energie attributes Add HomematicIP Cloud light power consumption and energie attributes Jul 7, 2018
@MartinHjelmare
Copy link
Copy Markdown
Member

Please add a paragraph in the description describing the breaking change, ie the change in the state attributes.

@worm-ee
Copy link
Copy Markdown
Contributor Author

worm-ee commented Jul 8, 2018

Hi Martin, thanks for your review. It’s not breaking - it’s new added.

"""MomematicIP measuring light device."""

@property
def current_power_w(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since these properties are removed, this is a breaking change.

@worm-ee
Copy link
Copy Markdown
Contributor Author

worm-ee commented Jul 8, 2018

Hi Martin, when I implemented the light platform I was not aware that those properties are not implemented like in the switch platform, now I have moved them to the state attributes. So I still think this not a breaking change, but you can still convince me :-)

@MartinHjelmare
Copy link
Copy Markdown
Member

Sorry, you're right. I was thinking this was the switch. 🤦‍♂️

@MartinHjelmare MartinHjelmare merged commit 1ff329d into home-assistant:dev Jul 9, 2018
@ghost ghost removed the in progress label Jul 9, 2018
awarecan pushed a commit to awarecan/home-assistant that referenced this pull request Jul 16, 2018
…ome-assistant#15343)

* Add power consumption and energie attributes

* Fix lint

* Change attribute name and include kwh
@balloob balloob mentioned this pull request Jul 20, 2018
michaeldavie pushed a commit to michaeldavie/home-assistant that referenced this pull request Jul 31, 2018
…ome-assistant#15343)

* Add power consumption and energie attributes

* Fix lint

* Change attribute name and include kwh
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
…ome-assistant#15343)

* Add power consumption and energie attributes

* Fix lint

* Change attribute name and include kwh
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants