The Zigbee specification mandates that temperatures are given in
1/100ths of degrees, and several devices are able to provide temperature
readings or accept target temperature settings with precision equal or
better than 0.1°C. Yet the ZHA climate entity implementation advertises
an hard-coded precision of 0.5°C.
Avoid arbitrary coarsening by advertising 0.1°C precision, as passing
through the full 0.01°C precision is probably not that useful.
* Refactor ZHA sensors to use cached values after restart
* Get attr from cluster, not channel
* Run cached state through formatter method
* Use cached values for div/multiplier for SmartEnergy channel
* Restore batter voltage from cache
* Refactor sensor to use cached values only
* Update tests
* Add battery sensor test
* Allow coordinator ZDO binding/unbinding operations
* Let coordinator to provide endpoint it
* Refactor ClusterPair to a dataclass
* Rename ClusterPair
* Send pro-active IAS Enroll Response
Some zigbee devices require a pro-active IAS enroll response to be sent before they will send their IAS enroll request. This PR sends a single IAS enroll response after CIE write and fixes some of these devices including the Ecolink 4655BC0-R and many others.
This also more closely aligns with the default behavior of Smartthings and zigbee2mqtt which also send pro-active enroll requests:
b217b91bb7 (diff-6d00af5fc389c40b8c4dfc390d80e3eca3946d331dff84afdc1632cb5568bca2)
Thanks to @puddly for helping figure this all out and @tubalainen for testing.
* flake8 fixes
* flake8 again
* Remove duplicated attribute request from ZHA
The on_off attribute is on the REPORT_CONFIG, so
super().async_initialize already requests it from the device.
No need to request it twice.
* Use skip_configuration flag to skip requests in ZHA
* Fix loading from cache
* Fix loading from cache condition