Files
core/tests/components
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
..
2023-03-28 14:59:03 +02:00
2023-02-02 18:35:24 +01:00
2023-02-15 14:09:50 +01:00
2023-03-22 20:00:47 -04:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-05 19:10:35 +01:00
2023-02-15 14:09:50 +01:00
2023-03-28 17:11:48 +02:00
2023-03-01 12:29:57 -05:00
2023-02-15 14:09:50 +01:00
2023-02-15 12:39:12 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-03-25 12:31:01 -10:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-03-10 12:06:50 +01:00
2023-03-01 21:19:20 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-03-02 12:33:04 +01:00
2023-02-03 23:08:48 +01:00
2023-02-02 18:35:24 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 16:46:03 -05:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 12:39:12 +01:00
2023-03-22 20:00:47 -04:00
2023-02-15 14:09:50 +01:00
2023-02-09 13:41:50 +01:00
2023-03-07 11:35:48 +01:00
2023-03-28 16:49:32 +02:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-22 10:18:58 +01:00
2023-03-22 20:00:47 -04:00
2023-03-28 08:46:16 +02:00
2023-02-15 12:39:12 +01:00
2023-01-27 13:57:06 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-03-07 11:35:48 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-02 18:35:24 +01:00
2023-03-01 16:33:32 +01:00
2023-02-15 14:09:50 +01:00
2023-01-27 09:09:46 +01:00
2023-02-15 14:09:50 +01:00
2023-03-10 12:06:50 +01:00
2023-03-08 10:53:08 -05:00
2023-02-15 14:09:50 +01:00
2023-03-10 12:06:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-22 13:55:44 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-03-15 18:54:28 +01:00
2023-03-22 20:00:47 -04:00
2023-03-28 16:29:24 +02:00
2023-03-28 11:54:16 +02:00
2023-02-15 14:09:50 +01:00
2023-02-02 18:35:24 +01:00
2023-03-22 20:00:47 -04:00
2023-01-27 09:09:46 +01:00
2023-01-20 13:42:47 +01:00
2023-03-04 22:26:16 +01:00
2023-03-26 07:24:43 +08:00
2023-02-17 21:08:18 -05:00
2023-03-22 20:00:47 -04:00
2023-03-15 10:07:12 +01:00
2023-03-27 20:00:54 +02:00
2023-02-23 22:15:20 -05:00
2023-02-15 14:09:50 +01:00
2023-02-28 22:12:48 -05:00
2023-02-02 18:35:24 +01:00
2023-02-19 21:14:10 -05:00
2023-01-30 14:06:52 +01:00
2023-03-26 20:03:03 +02:00
2023-03-27 23:11:49 +02:00
2023-03-22 12:01:04 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00