Commit graph

1586 commits

Author SHA1 Message Date
puddly
fd7d0fff1f
Bump ZHA dependencies (#91291) 2023-04-12 22:09:03 +02:00
David F. Mulcahey
0fee49a32e
Cleanup ZHA from Zigpy deprecated property removal (#91180) 2023-04-10 14:16:11 -04:00
David F. Mulcahey
90f857e926
Fix Smartthings acceleration sensor in ZHA (#91056) 2023-04-07 15:55:37 -10:00
David F. Mulcahey
62a6a4cd19
Bump ZHA quirks lib (#91054) 2023-04-07 19:00:03 -04:00
TheJulianJES
a58b3721ed
Restore state for ZHA OnOff binary sensors (#90749)
* Restore state for ZHA OnOff binary sensors

* Let `Motion` extend `Opening`

`Motion` is just a specified version of `Opening` that only changes the device class for some motion sensors.
Since we have more "special code" in the OnOff/Opening sensor now, we also want to make sure that gets applied to `Motion` binary sensors.

* Improve comment and type

* Add test to verify that binary sensors restore last HA state
2023-04-03 22:27:57 -04:00
puddly
3f398818c5
Perform an energy scan when downloading ZHA diagnostics (#90605) 2023-03-31 15:37:00 -04:00
puddly
84eb9c5f97
Fix ZHA definition error on received command (#90602)
* Fix use of deprecated command schema access

* Add a unit test
2023-03-31 14:53:42 -04:00
puddly
3a3c738945
Bump ZHA dependencies (#90547)
* Bump ZHA dependencies

* Ensure the network is formed on channel 15 when multi-PAN is in use
2023-03-30 20:55:01 -04:00
TheJulianJES
fd55d0f2dd
Migrate old ZHA IasZone sensor state to zigpy cache (#90508)
* Migrate old ZHA IasZone sensor state to zigpy cache

* Use correct type for ZoneStatus

* Test that migration happens

* Test that migration only happens once

* Fix parametrize
2023-03-30 11:15:12 -04:00
puddly
d0a492644d
Correctly load ZHA settings from API when integration is not running (#90476)
Correctly load settings from the zigpy database when ZHA is not running
2023-03-29 17:24:26 -04:00
TheJulianJES
47a2598b66
Add Aqara smoke sensor entities to ZHA (#90159)
* Add Aqara smoke sensor entities (WIP)

* Update smoke sensor entities (WIP)

* Drop two init attributes

* Move self-test button

* Remove self-test switch, add icons

* Add smoke sensor dbm entity

* Also add SMOKE device class to linkage alarm

Note: Enable "Linkage alarm" for this
2023-03-28 21:30:56 -04:00
TheJulianJES
12f49006cf
Add Aqara E1 thermostat entities to ZHA (#90158)
* Add Aqara E1 thermostat entities (WIP)

* Remove calibrate button for now

* Add diagnostic entity category to calibrated + external sensor

* Add multiplier for ZHA config number/away preset temp

* Set default multiplier correctly

* Add and use `CONFIG_DIAGNOSTIC_MATCH` for diagnostic entities
2023-03-28 21:12:21 -04:00
David F. Mulcahey
8660035027
Bump ZHA quirks to 0.0.95 (#90435) 2023-03-28 20:59:26 -04:00
MattWestb
ee2101ef38
Add binding of IKEA Matter Switch cluster in ZHA (#89623)
* Adding binding of IKEA Matter Switch cluster

IKEA Symfonisk Gen 2 is using Matter ZCL Switch command but on manufacture cluster then its not supported in ZVL R8 that need being bond for sending the commands to the coordinator.

* Update manufacturerspecific.py

* Update manufacturerspecific.py

Delete not needed function `@registries.BINDABLE_CLUSTERS.register(0xFC80)`
2023-03-28 19:33:06 -04:00
TheJulianJES
89a3c304c2
Refactor ZHA binary sensors to read from zigpy cache (#89481)
* Construct binary sensor state from zigpy cache (WIP)

* Workaround zha-quirks issue where "MotionWithReset" quirks don't update attribute cache (WIP)

zha-quirks currently has an issue where the ZONE_STATE attribute is updated (when the zone_STATUS changes).
https://github.com/zigpy/zha-device-handlers/pull/2231 is a proper fix for this.

For now, we just update the attribute cache when we get the "zone status update notification" command.

This wasn't noticed before, as the "attribute report signal" was sent from the `cluster_command()` method and the used the provided attribute (in the signal) to update the `_state` value in the binary sensor class.
As we just tell HA to write state again when we get an attribute report now, the ZONE_STATUS attribute is read now (and needs to be correct).

* Use parse() method of main class for IasZone entity (with stripped bits)

* Change wording in comment, remove explicitly sending attr signal

(This comment should be removed/changed later anyway)

* Remove note

* Get zone_status attribute id with zigpy

* Remove `security.` prefix for `IasZone` import

`AceCluster` was already directly imported and `IasZone` is too now for getting the attribute id

* Store full zone status attribute in cache

* Check that non-alarm bits are ignored in IasZone sensor test

* Re-enable occupancy binary sensor test

This test seems to work fine and I don't see any reason why it was commented out for a while

* Fix cached read mix-up for `zone_status`/`zone_state`

This allows cached reads for `zone_state` (enrolled or not), but forces a new read for `zone_status` (alarm or not).
2023-03-28 12:39:10 -04:00
Erik Montnemery
6739542a5d
Simplify some multi pan code (#90135)
* Simplify some multi pan code

* Adjust ZHA config flow
2023-03-23 09:18:35 +01:00
puddly
c581116c82
ZHA network settings API (#88564)
* Rename `zha.api` to `zha.websocket_api`

* Implement a ZHA network settings API

* Use the enum name as the radio type

* Don't filter out ignored config entries

* [WIP] Start unit tests

* Add unit tests

* Rename ZHA websocket API module in `.coveragerc`

* Rename `api` to `websocket_api`

* Increase test coverage to 100%
2023-03-22 11:15:46 -04:00
epenet
1303dd12e7
Improve type hints in zha fan (#90042) 2023-03-21 15:21:56 +01:00
puddly
cbffaf30ba
Bump ZHA dependencies (#89667)
* Bump `zha-quirks` library and account for `setup_quirks` signature

* Bump other ZHA dependencies

* Revert zigpy bump
2023-03-13 20:52:01 -04:00
TheJulianJES
d828263ee3
Add device class to ZHA Xiaomi plug "consumer connected" sensor (#89476)
Add device class to ZHA Xiaomi plug "consumer connected"
2023-03-09 20:15:22 -05:00
TheJulianJES
3989ef8863
Parse attribute reports for ZHA select entity (#89418)
* Parse attribute reports for ZHA select entity

* Add test for checking that select entity attribute reports are parsed
2023-03-09 07:01:18 -05:00
puddly
fa128fbcec
Clean ZHA radio path with trailing whitespace (#89299)
* Clean config flow entries with trailing whitespace

* Rewrite the config entry at runtime, without upgrading

* Skip intermediate `data = config_entry.data` variable

* Perform a deepcopy to ensure the config entry will actually be updated
2023-03-07 20:24:08 -05:00
epenet
91e389c58d
Bump ruff to 0.0.253 (#89211)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-06 16:16:31 +01:00
Guy Martin
7365522d1f
Add matching on quirk_classes to zha (#87653)
* Add matching on quirk_classes.

* Add and fix tests for matching on quirk_classes.

* Black fix.

* Add a unit test to validate quirk classes.
2023-03-02 19:43:11 -05:00
epenet
3e8716b37e
Adjust AddEntitiesCallback import (part 2) (#88873) 2023-02-28 22:01:36 -05:00
puddly
7a5a882687
Bump ZHA dependencies (#88799)
* Bump ZHA dependencies

* Use `importlib.metadata.version` to get package versions
2023-02-27 15:07:57 -05:00
Paulus Schoutsen
9be3f86a4c
Check circular dependencies (#88778) 2023-02-26 20:25:29 -05:00
Joakim Sørensen
0f204d6502
Remove homeassistant_hardware after dependency from zha (#88751) 2023-02-25 12:01:01 +01:00
puddly
9575cd9161
Name the Yellow-internal radio and multi-PAN addon as ZHA serial ports (#88208)
* Expose the Yellow-internal radio and multi-PAN addon as named serial ports

* Remove the serial number if it isn't available

* Use consistent names for the addon and Zigbee radio

* Add `homeassistant_hardware` and `_yellow` as `after_dependencies`

* Handle `hassio` not existing when listing serial ports

* Add unit tests
2023-02-23 20:52:53 -05:00
puddly
2a819f23c1
Disable the ZHA bellows UART thread when connecting to a TCP coordinator (#88202)
Disable the bellows UART thread when connecting to a TCP coordinator
2023-02-22 15:12:55 -05:00
David F. Mulcahey
205c5ccbf3
Bump ZHA quirks to 0.0.93 (#88621) 2023-02-22 20:27:36 +01:00
TheJulianJES
5bffbafae4
Add ZHA "consumer connected" binary sensor for Xiaomi EU plugs (#88194)
* Initialize consumer_connected attribute

* Add binary sensor for consumer_connected
2023-02-22 14:47:43 +01:00
Paulus Schoutsen
3a32d2bdcb
Add background tasks to config entries (#88335)
* Use a set for config entries task tracking

* Allow adding background tasks to config entries

* Add tests for config entry add tasks

* Update docstrings on core create task

* Migrate roon and august

* Use in more places

* Guard for None
2023-02-17 13:50:05 -05:00
Paulus Schoutsen
093f7d6bf1
Fix dangling task for zha (#88302) 2023-02-16 23:07:15 -05:00
J. Nick Koston
4221433ca6
Account for changed python3.11 enum.IntFlag 0 behavior in zha (#88144) 2023-02-15 11:40:48 -06: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
Erik Montnemery
6c2702a7b8
Sort manifests 11 (#87032) 2023-02-08 20:10:18 +01:00
epenet
1b23429f41
Add __init__ return type to integrations (#87637) 2023-02-07 15:55:14 +01:00
Marc Mueller
a5d376069a
Add Self typing (2) [mypy 1.0] (#87599) 2023-02-06 23:23:52 -05:00
Marc Mueller
4fbb14ecc7
Update mypy to 1.0.0 (#87586) 2023-02-07 02:31:14 +01:00
Franck Nijhof
939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
epenet
bb3e0633a4
Add init return type to integrations (#87523)
Add type hints to integrations
2023-02-06 11:37:25 +01:00
GitHub Action
f475446ebf [ci skip] Translation update 2023-02-06 00:23:07 +00:00
Franck Nijhof
fcb612cd6f
Collection of code styling tweaks (#87344) 2023-02-03 23:51:27 +01:00
Franck Nijhof
ca1a12898c
Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
GitHub Action
0f80932709 [ci skip] Translation update 2023-02-02 00:25:01 +00:00
GitHub Action
be73e43989 [ci skip] Translation update 2023-02-01 00:27:42 +00:00
puddly
47453420c1
Bump ZHA dependencies (#86979)
Bump ZHA dependency bellows from 0.34.6 to 0.34.7
2023-01-30 21:35:27 -05:00
puddly
8337d4613e
ZHA config flow cleanup (#86742)
fixes undefined
2023-01-30 22:21:34 +01:00