Commit Graph

20 Commits (d8e541a28439e7e91ced97de3a639da55c23abc1)

Author SHA1 Message Date
puddly 23839a7f10
Wrap most ZHA exceptions in `HomeAssistantError` (#98421)
* Wrap attribute writes in a helper throwing `HomeAssistantError`

* Do not check for `Exception` instances, they are now propagated

* Write `cie_addr` synchronously

* Fix unnecessary `if` in `async_set_native_value`

* Fix unit tests

* Use `HomeAssistantError` in cover commands

* Revert writing `cie_addr` synchronously

* Disallow proxying of some cluster methods to fix unit test warnings

* Unit test cover failures to increase coverage

* Unit test missing climate device

* Unit test remaining cover commands
2023-08-28 17:24:12 -04:00
Marc Mueller 544d6b05a5
Replace mock_coro with AsyncMock (#99014)
* Replace mock_coro with AsyncMock

* Remove mock_coro test helper function

* Remove redundant AsyncMock
2023-08-25 22:54:55 +02:00
puddly 22dfa8797f
Bump ZHA dependencies (#93989)
* 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
2023-06-14 21:42:31 -04:00
epenet 7427d4f323
Add type hints to integration tests (zha) (#88309) 2023-02-17 18:54:26 +01:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Erik Montnemery cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
TheJulianJES 6582ee3591
Use ExecuteIfOff on color cluster for supported bulbs with ZHA (#84874)
* Add options and execute_if_off_supported properties to Color channel

* Initialize "options" attribute on Color channel (allowing cache)

* Implement execute_if_off_supported for ZHA lights

* Make sure that color_channel exists, before checking execute_if_off_supported

* Replace "color_channel is not None" check with simplified "if color_channel"

* Make "test_number" test expect "options" for init attribute

* Add test_on_with_off_color test to test old and new behavior

* Experimental code to also support "execute_if_off" for groups if all members support it

* Remove support for groups for now

Group support will likely be added in a separate PR. For now, the old/standard behavior is used for groups.
2023-01-23 07:58:18 -05:00
TheJulianJES f740312247
Fix some typos in ZHA comments (#84881)
* Fix copy paste errors

* Fix "setup/set up" usage

* Fix typo

* Fix comment

* Fix copy paste errors

* Remove space at end of comment

* Remove double word

* Fix copy paste errors

* Fix typos

* Apply review suggestion

* Upper-case zha (to ZHA) everywhere

* Review: fix "over rules"

* Review: most/more
2023-01-02 00:20:59 -05:00
Julian Löhr 6795627734
Add ZHA StartUpColorTemperature configuration entity (#80853)
* Add ZHA start up color temperature entity

* Use device reported min max values

* Add color number test

* Fix code style
2022-10-23 18:46:47 -04:00
TheJulianJES 3126762707
Add friendly name to ZHA config entities (#79926)
* Add friendly name to ZHA config entities

* Follow HA capitalization conventions

* Change from "Start-up level" to "Start-up current level"

* Remove siren select friendly names (temporarily)

* Change tests to expect new entity ids

* Re-add siren select friendly names

* Change siren tests to expect new entity ids
2022-10-09 09:11:42 -04:00
epenet 25b1dfb53a
Cleanup EntityCategory in tests (#78808) 2022-09-20 10:49:44 -04:00
David F. Mulcahey 6f28e4bfee
Migrate ZHA to new entity naming standard (#74846) 2022-07-10 13:17:59 -07:00
J. Nick Koston 4bc5d7bfed
Speed up zha tests (#73627) 2022-06-17 11:41:10 -05:00
David F. Mulcahey 57c94c0350
Add additional configuration entities for ZHA lights (#70597)
* Add more configuration entities for ZHA lights

* fix typing circular imports

* enhance filter in entity factory

* fix read attribute chunking

* add test

* add exception test
2022-05-16 13:04:32 -04:00
epenet 8234625d30
Use Domain not Platform on test service calls (#65508)
* Adjust atag

* adjust broadlink

* Adjust onewire

* Adjust plex

* Adjust renault

* Adjust tasmota

* Adjust zha

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-02-03 14:16:35 +01:00
David F. Mulcahey a17031630f
Use Platform enum in ZHA (#61016) 2021-12-11 11:06:39 -05:00
Alexei Chetroi a5d405700c
ZHA channel ZCL attributes initialization (#56476)
* Add dict of attributes to initialize

* Refactor get_attributes() method

Read 5 attributes at the time.

* Add ZCL_INIT_ATTRS attribute to base Zigbee channel

* Update tests and general clusters

* Update channels to use ZCL_INIT_ATTRS

* Update channels to use ZCL_INIT_ATTRS

* Fix tests

* Refactor async_initialize() to be a retryable request

* Maky pylint happy again
2021-09-22 11:34:30 -04:00
Alexei Chetroi c6888e4faf
Refactor ZHA tests (#55844)
* Replace ZHA tests FakeDevice

* Refactor ZHA tests to use zigpy devices and endpoints

* Use common consts for zigpy device mocks

Use the same dict key names for device signature mocks as zha quirks.

* Use const for test device list

* Update tests/components/zha/common.py
2021-09-06 19:00:06 -04:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Shulyaka 0b8529a472
Add zha AnalogOutput cluster support (#44092)
* Initial commit
* black
* isort
* Commit suggestion from code review
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>

* pylint
* removed entity cache for present_value
* fix discovery
* move write_attributes to channel
* write_attributes fix
* write_attributes yet another fix
* update_before_add=False
* mains powered test device
* removed test_restore_state
* flake8
* removed async_configure_channel_specific
* don't know what this patch does, removing
* test for async_update
* removed node_descriptor
* fix unit_of_measurement
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-12-14 15:32:45 -05:00