Commit graph

70 commits

Author SHA1 Message Date
puddly
74bec58bfa
Fix ZHA group creation (#69629) 2022-04-07 15:02:14 -07:00
puddly
0f6296e4b5
Bump zigpy to 0.44.1 and zha-quirks to 0.0.69 (#68921)
* Make unit tests pass

* Flip response type check to not rely on it being a list
https://github.com/zigpy/zigpy/pull/716#issuecomment-1025236190

* Bump zigpy and quirks versions to ZCLR8 releases

* Fix renamed zigpy cluster attributes

* Handle the default response for ZLL `get_group_identifiers`

* Add more error context to `stage failed` errors

* Fix unit test returning lists as ZCL request responses

* Always load quirks when testing ZHA

* Bump zha-quirks to 0.0.69
2022-03-31 11:26:27 -04:00
Marc Mueller
006fa9b700
Improve zha typing [api] (5) (#68684) 2022-03-30 15:54:31 +02:00
Marc Mueller
3ef912b7a0
Improve zha typing [api] (4) (#68649) 2022-03-25 18:09:15 +01:00
Marc Mueller
6ac9c105c1
Improve zha websocket api logic (#68648) 2022-03-25 17:45:47 +01:00
Marc Mueller
b3632f3efe
Simplify zha IEEE validation schema (#68645) 2022-03-25 12:04:12 -04:00
Marc Mueller
6a66b4dbff
Add zha typing [api] (3) (#68353) 2022-03-22 10:15:39 -04:00
Marc Mueller
ffcc02e93d
Add zha typing [api] (2) (#68335) 2022-03-18 19:06:44 +01:00
Marc Mueller
ad84a02b8e
Add zha typing [api] (1) (#68220) 2022-03-18 09:23:52 +01:00
epenet
803eaa8e22
Ensure admin service calls are typed (#63093)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-30 21:12:40 +01:00
Marc Mueller
72801867d6
Use assignment expressions 38 (#58828) 2021-10-31 18:49:18 +01:00
puddly
c404a196c2
Allow creating ZHA groups with specific IDs (#50781) 2021-06-27 15:21:15 -04:00
David F. Mulcahey
55050bdd2a
support more alarm panels (#50235) 2021-05-07 08:31:16 -04:00
David F. Mulcahey
a644c2e8ba
Add alarm control panel support to ZHA (#49080)
* start implementation of IAS ACE

* starting alarm control panel

* enums

* use new enums from zigpy

* fix import

* write state

* fix registries after rebase

* remove extra line

* cleanup

* fix deprecation warning

* updates to catch up with codebase evolution

* minor updates

* cleanup

* implement more ias ace functionality

* cleanup

* make config helper work for supplied section

* connect to configuration

* use ha async_create_task

* add some tests

* remove unused restore method

* update tests

* add tests from panel POV

* dynamically include alarm control panel config

* fix import

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2021-04-27 10:58:59 -04:00
David F. Mulcahey
b91d2be00b
Better ZHA device reconfiguration (#49672)
* initial take

* cleanup

* fix mock for configure_reporting
2021-04-27 10:04:22 -04:00
David F. Mulcahey
fe80afdb86
Add support for custom configurations in ZHA (#48423)
* initial configuration options

* first crack at saving the data

* constants

* implement initial options

* make more dynamic

* fix unload and reload of the config entry

* update unload
2021-04-12 07:08:42 -04:00
David F. Mulcahey
aa0292974a
support feedback for ZHA device reconfiguration (#48447) 2021-03-30 16:35:51 -04:00
David F. Mulcahey
01fcc41aa0
only block coord removal if it is active (#48147) 2021-03-20 17:26:23 -04:00
tkdrob
3baeed3684
Clean up constants (#47323) 2021-03-05 19:08:04 +01:00
David F. Mulcahey
51e695fd45
add api to refresh topology (#44840) 2021-02-03 15:35:05 -05:00
Alexei Chetroi
4b7829d777
Allow ZHA coordinator binding/unbinding (#42854)
* Allow coordinator ZDO binding/unbinding operations

* Let coordinator to provide endpoint it

* Refactor ClusterPair to a dataclass

* Rename ClusterPair
2020-11-06 17:33:13 -05:00
Alexei Chetroi
c29f613b1d
Fix schema for set_zigbee_cluster_attribute service (#41850) 2020-10-16 20:02:14 -04:00
Alexei Chetroi
47286fbe2a
Refactor permit services to allow joining using install codes (#40652)
* Update zha.permit schema to support install code

* Move install code to core helpers

* QR code converter for enbrighten

* Fix schemas

* Update test for permit service

* Refactor zha.permit to accept install codes

* Test zha.permit from QR code

* Fix regex for Embrighten QR code

* Add regex for Aqara QR codes

* Add Consciot regex for QR code

* Reuse test params for WS tests

* ZHA WS permit command with install code

* Tests for zha.permit WS service

* Refactor zha.permit and zha.remove service to use ATTR_IEEE for the address

* Make pylint happy

* Deprecate only ieee_address param for now
2020-09-28 20:55:08 -04:00
Alexei Chetroi
f09f7feb94
Update schema for zha.set_zigbee_cluster_attribute service (#40600) 2020-09-25 18:36:55 -04:00
Ville Skyttä
b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
David F. Mulcahey
8279efc164
Group by endpoints and not by devices for ZHA Zigbee groups (#34583)
* start implementation
* handle members correctly
* fix group member info
* align groupable devices with group members
* handle group endpoint adding and removing
* update add group
* update group and group member
* update create group
* remove domain check
* update test
* remove temporary 2nd groupable device api
* update test
* rename validator - review comment
* fix test that was never running
* additional testing
* fix coordinator descriptors
* remove check that was done twice
* update test
* Use AsyncMock()
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-05-04 15:19:53 -04:00
Karthikeyan Singaravelan
ab493eba96
Import ABC from collections.abc instead of collections for Pyt… (#34077) 2020-04-12 18:00:57 +02:00
springstan
e3bcfb88e7
Improve string formatting v4 (#33668)
* Improve string formatting v4

* Use normal strings instead of f-strings

* Fix zeroconf test by adding back part of a condition
2020-04-05 16:01:41 +02:00
David F. Mulcahey
ef61118d49
fix ZHA IASWD commands (#33402) 2020-03-29 17:42:37 -04:00
Paulus Schoutsen
e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
David F. Mulcahey
f4a4c6bea5
ZHA group and device cleanup (#31260)
* add dispatching of groups to light
* added ha device registry device id
* added zha group object
* add group event listener
* add and remove group members
* get group by name
* api cleanup
* clean up get device info
* create and remove zigpy groups
* clean up create and remove group api
* use device id
* use device id
* cleanup
* update test
* update tests to allow group events to flow
2020-01-29 12:24:43 -05:00
David F. Mulcahey
7d9c8fdfa0
update remove service (#31164) 2020-01-27 08:54:31 -05:00
David F. Mulcahey
3c44a1353a change group id creation (#31075) 2020-01-22 09:23:35 -05:00
David F. Mulcahey
41014d73be
Allow ZHA device creation for the Zigbee coordinator (#31032)
* allow zha device creation for coordinator

* don't let coordinator get removed

* fix truthy issue in logical device type
2020-01-21 06:07:47 -05:00
David F. Mulcahey
6c89b6c5a2 Add Zigbee group binding to ZHA (#30433)
* initial group binding work
* add group cluster binding
2020-01-04 16:58:51 -05:00
Ville Skyttä
fa4fa30461 Various string cleanups (#30435)
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
David F. Mulcahey
85d2ba047b Protect against bad data stored in ZHA (#30183) 2019-12-23 19:11:35 -05:00
Alexei Chetroi
7685c76b9b
Defer log formatting. (#29888) 2019-12-12 14:16:02 -05:00
Alexei Chetroi
327b5c3c94
Log ZHA bind/unbind operations status (#29842)
* Log bind/unbind operation result.
* Use ZDO consts.
* Use device logger for bind/unbind results.
* Lint.
2019-12-12 12:16:51 -05:00
Alexei Chetroi
315d0064fe
Fix zha circular import (#29802)
* Refactor zha.core.helpers.
* Make zha isort-able.
* Const import reorg.
* Keep DATA_ZHA config key on entry unload.
* Cleanup ZHA config flow.
* isort.
* Add test.
2019-12-10 00:00:04 -05:00
David F. Mulcahey
1222aa8c56 Add ZHA group API (#29641)
* add skeleton to retrieve zigbee groups
* get single group
* add a group
* return group members with group
* add comment
* fix group members
* add function to add device to group
* add group members
* add remove from group method
* add api to remove members from group
* add remove groups method
* clean up group add and remove
* fix remove group
* fix remove groups
* add api to get only groupable devices
* change var init
* add tests
* address review comment
2019-12-09 14:50:04 -05:00
Alexei Chetroi
4ba2bd232c Command arguments for issue_zigbee_cluster_commands. (#28885) 2019-11-20 08:34:06 -05:00
Abílio Costa
e60ae77f1b Add ZHA service to issue group commands (#28823)
* add service to ZHA to issue group commands
* fix args
2019-11-19 19:49:09 -05:00
Alexei Chetroi
fe7c45b363
Move remaining of ZHA imports to top level. (#28071)
* Move ZHA import to top level.
* ZHA tests: move imports to top level.
2019-10-21 19:30:56 -04:00
Alexei Chetroi
a0c50f4794 Leverage zigpy for IEEE address conversions (#27972)
* Refactor EUI64 conversions.

* Update ZHA dependencies.

* Update tests.
2019-10-21 13:14:17 -04:00
David F. Mulcahey
62adff23f9 ZHA siren and warning device support (#26046)
* add ias warning device support
* use channel only clusters for warning devices
* squawk service
* add warning device warning service
* update services.yaml
* remove debugging statement
* update required attr access
* fix constant
* add error logging to IASWD services
2019-09-20 15:11:24 -04:00
Franck Nijhof
dae6895a95 Use literal string interpolation in integrations X-Z (f-strings) (#26395) 2019-09-03 21:15:31 +02:00
David F. Mulcahey
6f2ac705eb
Add web socket API command to get a single ZHA device (#26196)
* get single device web socket command

* test get single device

* add not found error

* fix handling when device doesn't exist

* add test for zha device not found
2019-08-26 09:54:19 -04:00
Alexei Chetroi
0c561aec4f
isort ZHA imports. (#25660) 2019-08-02 10:37:21 -04:00
Alexei Chetroi
77e4ff94fd ZHA code cleanup. (#25644)
* isort ZHA imports.

* Sort zha channel registry.

* Sort ZHA core registry.

* Sort ZHA core consts.
2019-08-02 06:05:23 -04:00