🏡 Open source home automation that puts local control and privacy first.
Go to file
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
.devcontainer Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00
.github Fail CI if codecov upload fails (#90363) 2023-03-27 20:49:49 +02:00
.vscode Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00
docs Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
homeassistant Refactor ZHA binary sensors to read from zigpy cache (#89481) 2023-03-28 12:39:10 -04:00
machine Add Hardkernel ODROID-M1 (#89431) 2023-03-09 14:18:19 +01:00
pylint/plugins Add RestoreEntity pylint checks to all platforms (#90020) 2023-03-27 20:08:20 +02:00
rootfs Fix logging & exit code reporting to S6 on HA shutdown (#72921) 2022-06-02 19:49:08 +02:00
script Bump cryptography to 40.0.1 (#90326) 2023-03-26 12:30:17 -10:00
tests Refactor ZHA binary sensors to read from zigpy cache (#89481) 2023-03-28 12:39:10 -04:00
.core_files.yaml Adjust IntFlag handling in syrupy (#90223) 2023-03-26 14:20:05 +02:00
.coveragerc Add tests to Lidarr (#79610) 2023-03-28 16:49:32 +02:00
.dockerignore Not to Tox (#76582) 2022-11-23 14:40:37 +01:00
.gitattributes
.gitignore Remove translations from Core (#87543) 2023-02-06 15:06:43 +01:00
.hadolint.yaml
.pre-commit-config.yaml Drop autoflake in favor of Ruff (#89874) 2023-03-17 21:37:41 +01:00
.prettierignore Add tests to Lidarr (#79610) 2023-03-28 16:49:32 +02:00
.readthedocs.yml Update readthedocs config (#65230) 2022-01-30 20:15:32 -08:00
.strict-typing Strict typing of UniFi integration (#90278) 2023-03-26 09:57:13 +02:00
.yamllint Add filters to climate and light service descriptions (#86162) 2023-03-16 15:59:51 +01:00
CLA.md
CODEOWNERS Implement config flow for nextcloud (#89396) 2023-03-26 21:14:17 +02:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#73468) 2022-06-23 01:41:22 +02:00
CONTRIBUTING.md
Dockerfile 75142 Added QEMU_CPU ARG to the dockerfile (#86178) 2023-01-19 10:22:23 +01:00
Dockerfile.dev Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00
LICENSE.md
MANIFEST.in Move remaining keys to `setup.cfg` (#65154) 2022-01-28 20:18:09 -08:00
README.rst Change README demo to demo.home-assistant.io subdomain (#89921) 2023-03-19 07:52:42 +01:00
build.yaml Bump docker base to 2023.02.0 (#88084) 2023-02-14 20:34:54 -05:00
codecov.yml Add recorder platform to required test category (#86704) 2023-01-26 11:03:56 +01:00
mypy.ini Strict typing of UniFi integration (#90278) 2023-03-26 09:57:13 +02:00
pyproject.toml Bump cryptography to 40.0.1 (#90326) 2023-03-26 12:30:17 -10:00
requirements.txt Bump cryptography to 40.0.1 (#90326) 2023-03-26 12:30:17 -10:00
requirements_all.txt Update zwave-me-ws version to 0.3.6 (#90233) 2023-03-28 17:24:19 +02:00
requirements_docs.txt
requirements_test.txt Update pipdeptree to 2.7.0 (#90312) 2023-03-26 09:47:47 -10:00
requirements_test_all.txt Update zwave-me-ws version to 0.3.6 (#90233) 2023-03-28 17:24:19 +02:00
requirements_test_pre_commit.txt Drop autoflake in favor of Ruff (#89874) 2023-03-17 21:37:41 +01:00
setup.cfg Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00

README.rst

Home Assistant |Chat Status|
=================================================================================

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://demo.home-assistant.io>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation/>`__ and `documentation <https://home-assistant.io/docs/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-integrations|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/architecture_index/>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/creating_component_index/>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.githubusercontent.com/home-assistant/core/master/docs/screenshots.png
   :target: https://demo.home-assistant.io
.. |screenshot-integrations| image:: https://raw.githubusercontent.com/home-assistant/core/dev/docs/screenshot-integrations.png
   :target: https://home-assistant.io/integrations/