From 0abe7a600d9b0790f44f086cf33086a6a4aa3a69 Mon Sep 17 00:00:00 2001 From: Jason Madigan Date: Wed, 18 Sep 2024 21:02:23 +0100 Subject: [PATCH] add triggered state --- custom_components/hkc_alarm/alarm_control_panel.py | 5 ++++- custom_components/hkc_alarm/manifest.json | 2 +- hacs.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/custom_components/hkc_alarm/alarm_control_panel.py b/custom_components/hkc_alarm/alarm_control_panel.py index d0cf48c..903840a 100644 --- a/custom_components/hkc_alarm/alarm_control_panel.py +++ b/custom_components/hkc_alarm/alarm_control_panel.py @@ -108,7 +108,9 @@ def _handle_coordinator_update(self) -> None: self._panel_data = panel_data blocks = status.get("blocks", []) - if any(block["armState"] == 3 for block in blocks): + if any(block["inAlarm"] for block in blocks): + self._state = "triggered" + elif any(block["armState"] == 3 for block in blocks): self._state = "armed_away" elif any(block["armState"] == 2 for block in blocks): self._state = "armed_night" @@ -116,6 +118,7 @@ def _handle_coordinator_update(self) -> None: self._state = "armed_home" else: self._state = "disarmed" + self.async_write_ha_state() # Update the state with the latest data diff --git a/custom_components/hkc_alarm/manifest.json b/custom_components/hkc_alarm/manifest.json index d5ec96a..563442b 100644 --- a/custom_components/hkc_alarm/manifest.json +++ b/custom_components/hkc_alarm/manifest.json @@ -1,7 +1,7 @@ { "domain": "hkc_alarm", "name": "HKC Alarm", - "version": "1.0.13", + "version": "1.0.19", "documentation": "https://github.com/jasonmadigan/ha-hkc", "issue_tracker": "https://github.com/jasonmadigan/ha-hkc/issues", "dependencies": [], diff --git a/hacs.json b/hacs.json index a31acca..fe68d9f 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "HKC Alarm Integration for Home Assistant", - "hacs": "1.0.16", + "hacs": "1.0.19", "render_readme": true, "homeassistant": "2024.6.4" } \ No newline at end of file