* zha integration: Add danfoss specific clusters and attributes; add thermostat.pi_heating_demand and thermostat_ui.keypad_lockout
* zha integration: fix Danfoss thermostat viewing direction not working because of use of bitmap8 instead of enum8
* ZHA Integration: add missing ThermostatChannelSensor
* ZHA integration: format using black
* zha integration: fix flake8 issues
* ZHA danfoss: Add MinHeatSetpointLimit, MaxHeatSetpointLimit, add reporting and read config for danfoss and keypad_lockout.
* ZHA danfoss: fix mypy complaining about type of _attr_entity_category
* ZHA danfoss: ruff fix
* fix tests
* pylint: disable-next=hass-invalid-inheritance
* fix pylint tests
* refactoring
* remove scheduled setpoint
* remove scheduled setpoint in manufacturer specific
* refactor
* fix tests
* change cluster ids
* remove custom clusters
* code quality
* match clusters in manufacturerspecific on quirk class
* fix comment
* fix match on quirk in manufacturerspecific.py
* correctly extend cluster handlers in manufacturerspecific.py and remove workaround for illegal use of attribute updated signals in climate.py
* fix style
* allow non-danfoss thermostats to work in manufacturerspecific.py
* correct order of init of parent and subclasses in manufacturerspecific.py
* improve entity names
* fix pylint
* explicitly state changing size of tuple
* ignore tuple size change error
* really ignore error
* initial
* fix tests
* match on specific name and quirk name
* don't restructure file as it is out of scope
* move back
* remove unnecessary change
* fix tests
* fix tests
* remove code duplication
* reduce code duplication
* empty line
* remove unused variable
* end file on newline
* comply with recent PRs
* correctly initialize all attributes
* comply with recent PRs
* make class variables private
* forgot one reference
* swap 2 lines for consistency
* reorder 2 lines
* fix tests
* align with recent PR
* store cluster handlers in only one place
* edit tests
* use correct device for quirk id
* change quirk id
* fix tests
* even if there is a quirk id, it doesn't have to have a specific cluster handler
* add tests
* use quirk id for manufacturer specific cluster handlers
* use quirk_ids instead of quirks_classes
* rename quirk_id
* rename quirk_id
* forgot to rename here
* rename id
* add tests
* fix tests
* fix tests
* use quirk ids from zha_quirks
* use quirk id from zha_quirks
* wrong translation
* sync changes with ZCL branch
* sync
* style
* merge error
* move bitmapSensor
* merge error
* merge error
* watch the capitals
* fix entity categories
* more decapitalization
* translate BitmapSensor
* translate all enums
* translate all enums
* don't convert camelcase to snakecase
* don't change enums at all
* remove comments
* fix bitmaps and add enum for algorithm scale factor
* improve readability if bitmapsensor
* fix capitals
* better setpoint response time
* feedback
* lowercase every enum to adhere to the translation_key standard
* remove enum state translations and use enums from quirks
* correctly capitalize OrientationEnum
* bump zha dependencies; this will have to be done in a separate PR, but this aids review
* accidentally removed enum
* tests
* comment
* Migrate reporting and ZCL attribute config out of `__init__`
* hvac.py shouldn't be changed in this pull request
* change wording comment
* I forgot I changed the size of the tuple.
---------
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
* Add counter entities to the ZHA coordinator device
* rework to prepare for non coordinator device counters
* Initial scaffolding to support quirks v2 entities
* update for zigpy changes
* add assertion error message
* clean up test
* update group entity discovery kwargs
* constants and clearer names
* apply custom device configuration
* quirks switches
* quirks select entities
* quirks sensor entities
* update discovery
* move call to super
* add complex quirks v2 discovery test
* remove duplicate replaces
* add quirks v2 button entity support
* add quirks v2 binary sensor entity support
* fix exception in counter entitiy discovery
* oops
* update formatting
* support custom on and off values
* logging
* don't filter out entities quirks says should be created
* fix type alias warnings
* sync up with zigpy changes and additions
* add a binary sensor test
* button coverage
* switch coverage
* initial select coverage
* number coverage
* sensor coverage
* update discovery after rebase
* coverage
* single line
* line lengths
* fix double underscore
* review comments
* set category from quirks in base entity
* line lengths
* move comment
* imports
* simplify
* simplify
* Add counter entities to the ZHA coordinator device
* rework to prepare for non coordinator device counters
* counter entity test
* update log lines
* disable by default
* Do not create `current_summ_received` entity until initialized once
* Update zha_devices_list.py to not expect summation received entities
The attribute isn't initialized for these devices in the test (which our check now expects it to be), hence we need to remove them from this list.
* Update sensor tests to have initial state for current_summ_received entity
The attribute needs to be initialized for it to be created which we do by plugging the attribute read.
The test expects the initial state to be "unknown", but hence we plugged the attribute (to create the entity), the state is whatever we plug the attribute read as.
* Update sensor tests to expect not updating current_summ_received entity if it doesn't exist
* aqara curtain motor opened by hand binary sensor
add icon and translation key for identify button
remove previous inversion entity
add window covering type sensor and aqara curtain motor sensors
add aqara curtain motor hook lock switch
add aqara curtain motor attributes zcl_init_attrs
add aqara curtain motor zcl_init_attrs
translations
* update translation string
* review comments
* use enum sensor after rebase
* remove button change
* Correct handling of power_factor ElectricalMeasurement attribute
The Zigbee Cluster Library defines PowerFactor as an int8 with value supported from -100 to 100.
Currently the zha sensor handler attempts to apply the ac_power_divisor and ac_power_multiplier formatters against the attribute value, the spec outlines that this should not be the case.
The impact of the current code is that quirks not using the default values of 1 are multiplying/dividing
power and power factor values prior to updating the cluster attribute.
This results in either a non-conformant power_factor e.g. the value was multiplied by 10 so that an ac_power_divider of 10 could be used, or the power readings sacrificing a point of measurement for lower readings.
Two quirks currently use this workaround:
* ts0601_din_power.py
* ts0601_rcbo.py
* Update ZHA Metering formatter to perform None check on _div_mul_prefix
To address feedback:
https://github.com/home-assistant/core/pull/107641#discussion_r1447547054
* _div_mul_prefix needs self reference
* Simplify None check for _div_mul_prefix
Co-authored-by: Joakim Plate <elupus@ecce.se>
* Updates to formatting and CI test typing fix
* Use ' | ' in place of Union
* Add tests for power_factor sensor
---------
Co-authored-by: Joakim Plate <elupus@ecce.se>
* Add sensor for exposing Summation Received from Metering cluster
* Ruff format
* Test updates for new sensor
* Update test_sensor.py to support summation_received
* Correct report_count for smart meterning and some pylint warning fixes
* Updating zha component to add entities for snzb06p
Sonoff snzb06p presence detector needs some custom entities.
* Updating ZCL_INIT_ATTRS for sonoff specific attrs
* updating cluster name due to change in quirk
* Dynamically map state class, device class and UoM in ZHA smart energy metering sensor
* Fix some state & device classes and add scaling
* Fix added imperial gallons tests
* Use entity description instead of custom class & add one entity to tests
* Apply code review suggestion
* Scale only when needed
* Revert "Scale only when needed"
This reverts commit a9e0403402.
* Avoid second lookup of entity description
* Change test to not mix sensor types
* Don't update entities until they are initialized
* fix hass reference
* only establish polling once
* fix log level and small cleanup
* start device availability checks after full initialization of network
* add logging
* clean up sensor polling and class hierarchy
* don't attempt restore sensor cleanup in this PR
* put check back
* fix race condition and remove parallel updates
* add sensor polling test
* cleanup switch polling and add a test
* clean up and actually fix race condition
* update light forced refresh
* only use flag
* unused flag
* reduce diff size
* collapse
* zha: Add translation to binary sensors
* Add some small test for name
* Add translations for sensors
* Correct some tests
* Adjust summation key
* Add translation keys for button
* Add translation keys to climate
* Add translation keys for cover
* Add translation keys to fan
* Add translations to light
* Add translations for lock
* Add translation keys to number
* Add translationk keys to select
* Add translations for switch entities
* Add translation to alarm control panel
* Map to some more standard device classes
* Use shorter references
* Remove explicit name from identify button
* Correct tests
* Correction after rebase
* Cache device triggers on startup
* reorg zha init
* don't reuse gateway
* don't nuke yaml configuration
* review comments
* Add unit tests
* Do not cache device and entity registries
* [WIP] Wrap ZHA data in a dataclass
* [WIP] Get unit tests passing
* Use a helper function for getting the gateway object to fix annotations
* Remove `bridge_id`
* Fix typing issues with entity references in group websocket info
* Use `Platform` instead of `str` for entity platform matching
* Use `get_zha_gateway` in a few more places
* Fix flaky unit test
* Use `slots` for ZHA data
Co-authored-by: J. Nick Koston <nick@koston.org>
---------
Co-authored-by: David F. Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Make `find_entity_id` synchronous
* Remove `tries`
* Use new `attribute_updated` event signature
* Validate attributes before creating entities
* Avoid swallowing exceptions when opening covers
* Bump ZHA dependencies
* Add a matcher for Sinope water leak sensors using a non-standard ZCL attribute
* Ensure handler matching is strict, not multi
* Add type annotations for newly-updated functions
* Always use `Light` for lights, including subclasses
* Clean up other platforms
* Add a unit test to ensure all future entity classes have names
* Remove stale `_name`
* Address review feedback and rename `Open` to `Opening`
* rename channel -> cluster handler
* remove refs to channels and create endpoint class
* remove remaining references to channels
* fix filter
* take in latest changes from #91403
* missed one
* missed a reference
* Add tier summation delivered for zlinky
* Improve name case
* Add other tiers and register tier
* Fix smartenergy sensor update
* Account for new reporting configuration in unit tests
* Use cluster ID attributes instead of hardcoding the values
* Use tier names instead of the numeric constants for formatter
* Revert active register tier delivered
* Fix tests
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
Fix RMS Voltage.
class ElectricalMeasurementRMSVoltage(ElectricalMeasurement, id_suffix="rms_voltage"): is using CURRENT as unit but shall being VOLTAGE.
Fix: https://github.com/home-assistant/core/issues/84537