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

ZHA entity ZCL reporting configuration #19177

Merged
merged 5 commits into from Dec 19, 2018

Conversation

@Adminiuga
Copy link
Contributor

Adminiuga commented Dec 11, 2018

Description:

This PR addresses ZCL attribute reporting configuration (not to be confused with device state attributes, have nothing to do with it).

Handle entity configuration via a method call. All ZHA entities (with the exception of IAS cluster based binary_sensor entities) are using using ZCL attribute reporting. This PR exposes a common interface for ZCL reporting configuration for any entity/cluster/attribure

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
@Adminiuga

This comment has been minimized.

Copy link
Contributor

Adminiuga commented Dec 11, 2018

@damarco @dmulcahey for visibility.

@Adminiuga Adminiuga force-pushed the Adminiuga:zha-zcl-report-config branch from 13c310a to fd489d0 Dec 11, 2018

Adminiuga added some commits Dec 5, 2018

Implement async_configure() method for ZHA entities.
Allow attribute reporting configuration to be stored as dict of zha
entity.

@Adminiuga Adminiuga force-pushed the Adminiuga:zha-zcl-report-config branch 2 times, most recently from fd27b5f to dbb3c56 Dec 11, 2018

Refactor async_configure() method.
Rename attribute reporting dict to zcl_reporting_config.

@Adminiuga Adminiuga force-pushed the Adminiuga:zha-zcl-report-config branch from dbb3c56 to e734312 Dec 11, 2018

@dmulcahey

This comment has been minimized.

Copy link
Contributor

dmulcahey commented Dec 17, 2018

@MartinHjelmare can we get this merged so that I can update all of my PR's that follow? We'd really like to get these in for .85 if at all possible. Thanks again for all of the help you give us!

@balloob balloob merged commit 4692605 into home-assistant:dev Dec 19, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 92.877%
Details

@wafflebot wafflebot bot removed the in progress label Dec 19, 2018

@@ -4,13 +4,20 @@
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
from asyncio import sleep

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Dec 19, 2018

Member

I prefer if we import asyncio and use that for asyncio functions so that it's clear what module we're using. Whenever I see sleep on its own in the code, it's a red flag.

Importing asyncio is also standard.

This comment has been minimized.

@Adminiuga

Adminiuga Dec 19, 2018

Contributor

I'll address this in subsequent PR
Thank you for feedback, being fairly new to Python this is helpful

This comment has been minimized.

@Adminiuga

Adminiuga Dec 19, 2018

Contributor

A follow up question: when do I import the entire module vs specific attribute?
eg for homeassistant,helpers.event.async_call_later() Do I import entire even and call event.async_call_later() or is it ok to do from homeassistant.helpers.event import async_call_later?

I've checked other components and different components do it differently.

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Dec 19, 2018

Member

If there's no standard, just pick one of the existing ways.

}
}
"""
return dict()

This comment has been minimized.

@MartinHjelmare

This comment has been minimized.

@Adminiuga

Adminiuga Dec 19, 2018

Contributor

I'll fix it in a new PR

@Adminiuga Adminiuga deleted the Adminiuga:zha-zcl-report-config branch Dec 19, 2018

@Adminiuga Adminiuga referenced this pull request Dec 19, 2018

Merged

Configure ZHA entity on new ZHA device join #19470

3 of 3 tasks complete

mxworm added a commit to mxworm/home-assistant that referenced this pull request Dec 21, 2018

Merge branch 'dev' into current
* dev: (75 commits)
  Add native ESPHome Home Assistant state feature (home-assistant#19429)
  Add new sensor platform to expose Islamic prayer times (home-assistant#19444)
  Add timeout to RainMachine login (home-assistant#19476)
  Reorder FLOW entries in config_entries.py (home-assistant#19475)
  Update pynetgear to 0.5.2 (home-assistant#19490)
  Rename ocr.png to ssocr-(entity_name).png to allow multiple instances (home-assistant#18634)
  Add Mythic Beasts DNSAPI Component (home-assistant#18333)
  Adds battery_percent which had been introduced with pyatmo 1.4 and resolves unknown var warning. (home-assistant#19309)
  Bump Pybotvac To Support D7 On Latest Firmware (home-assistant#19463)
  Add device registry to MQTT alarm control panel (home-assistant#19331)
  Add device registry to MQTT lock (home-assistant#19333)
  Bump pyharmony (home-assistant#19460)
  Add testcase test_entity_id_update
  Add device registry to MQTT climate
  Updated frontend to 20181219.0
  Update translations
  ZHA entity ZCL reporting configuration (home-assistant#19177)
  Use web sockets for Harmony HUB (home-assistant#19440)
  Correct calls to subscription.async_unsubscribe_topics (home-assistant#19414)
  Various updates (home-assistant#19449)
  ...

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

ZHA entity ZCL reporting configuration (home-assistant#19177)
* Implement async_configure() method for ZHA entities.

Allow attribute reporting configuration to be stored as dict of zha
entity.

* Update ZHA platform to use new attribute reporting configuration.

* Use const declaration instead of magic numbers.

* Add support for manufacturer_id in ZCL attribute reporting configuration.

* Refactor async_configure() method.

Rename attribute reporting dict to zcl_reporting_config.

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment