Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Phase out periodic tasks
* false by default or some tests will block forever, will need to fix each one manually
* kwarg works
* kwarg works
* kwarg works
* fixes
* fix more tests
* fix more tests
* fix lifx
* opensky
* pvpc_hourly_pricing
* adjust more
* adjust more
* smarttub
* adjust more
* adjust more
* adjust more
* adjust more
* adjust
* no eager executor
* zha
* qnap_qsw
* fix more
* fix fix
* docs
* its a wrapper now
* add more coverage
* coverage
* cover all combos
* more fixes
* more fixes
* more fixes
* remaining issues are legit bugs in tests
* make tplink test more predictable
* more fixes
* feedreader
* grind out some more
* make test race safe
* one more
* Never update the device path from config flows
* Bring coverage up to 100%
* Update tests/components/zha/test_config_flow.py
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
---------
Co-authored-by: TheJulianJES <TheJulianJES@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
* Use `None` instead of `"unknown"` when the current version is unknown
* Only use the current file version from the OTA notification
* Use `sw_version`, if available, and update `current_file_version`
* Assume the current version is the latest version
* Fix lint errors
* Use `image` instead of `firmware`
* Include a changelog if updates expose it
* Clear latest firmware only after updating the installed version
* Bump minimum zigpy version to 0.63.0
* Create a data update coordinator to consolidate updates
* Fix overridden `async_update`
* Fix most unit tests
* Simplify `test_devices` to fix current tests
* Use a dict comprehension for creating mocked entities
* Fix unit tests (thanks @dmulcahey!)
* Update the currently installed version on cluster attribute update
* Drop `PARALLEL_UPDATES` now that we use an update coordinator
* Drop `_reset_progress`, it is already handled by the update component
* Do not update the progress if we are not supposed to be updating
* Ignore latest version (e.g. if device attrs changed) if zigpy rejects it
* Clean up handling of command id in `Ota.cluster_command`
* Start progress at 1%: 0 and False are considered equal and are filtered!
Use `ceil` instead of remapping 1-100
* The installed version will be auto-updated when the upgrade succeeds
* Avoid 1 as well, it collides with `True`
* Bump zigpy to (unreleased) 0.63.2
* Fix unit tests
* Fix existing unit tests
Send both event types
Globally enable sending both event types
* Remove unnecessary branches
* Test ignoring invalid progress callbacks
* Test updating a device with a no longer compatible firmware
* Use discovery flow helper for hardware integrations
The discovery flow helper defers loading discovered integrations until after startup
to improve startup reliability.
* Use discovery flow helper for hardware integrations
The discovery flow helper defers loading discovered integrations until after startup
to improve startup reliability. Since hardware was not listed in as a
discovery integration, the notification for new discoveries was missing.
* 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
* Enable Bosch Outdoor Siren and Bosch Twinguard QR Codes
These devices contain inside their QR code device specific link keys instead of installation codes. Normally, the link key is generated from the installation code, but in this case we can directly pass the provided link key from QR code to zigpy application controller.
* Replace ZHA deprecated permit_with_key by permit_with_link_key
Convert installation code directly to link key
* Update tests
* formatting
* stub out zha update entity
* update matcher
* updates based on assumptions / conversation
* hook into current installed version
* post rebase cleanup
* incorporate zigpy changes
* fix async_setup_entry
* fix sw_version
* make ota work with config diagnostic match
* fix version format
* sync up with latest Zigpy changes
* fix name attribute
* disable ota providers for tests
* update device list
* review comment
* add current_file_version to Ota ZCL_INIT_ATTRS
* updates to update and start tests
* get installed version from restore data
* better version handling
* remove done todo notes
* reorganize test
* move image notify to cluster handler
* add test for manual update check
* firmware update success test
* coverage
* use zigpy defs
* clean up after rebase
* bump Zigpy
* cleanup from review comments
* fix busted F string
* fix empty error
* move inside check
* guard zigbee network from bulk check for updates
* 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>
* Allow `window_covering_type` to be `None`
* Create a `window_covering_mode` attribute and simplify inversion switch
* Revert "Create a `window_covering_mode` attribute and simplify inversion switch"
This reverts commit 048d649b4d.
* check both config status and mode
* coverage
---------
Co-authored-by: David Mulcahey <david.mulcahey@icloud.com>
* Update smartenergy.py metering_device_type enums
* Added missing enum 127
* Enum 127 is also electric metering type
* Meter type constants and status enums in smartenergy cluster handler
Addresses
https://github.com/home-assistant/core/pull/109126#discussion_r1471383887
Whilst I have the code open I've also added status handlers for the non-electrical meter types.
* New tests for different metering device type statuses
* 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