From 4e164273ff08541215726a0dfca8566dd9b77119 Mon Sep 17 00:00:00 2001 From: Jordan Harrison <76656637+jouwdan@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:13:42 +0100 Subject: [PATCH] fix(29): Add input states for tamper & inhibited --- custom_components/hkc_alarm/sensor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom_components/hkc_alarm/sensor.py b/custom_components/hkc_alarm/sensor.py index 1ab74ac..2a435b3 100644 --- a/custom_components/hkc_alarm/sensor.py +++ b/custom_components/hkc_alarm/sensor.py @@ -141,6 +141,16 @@ def state(self): f"Sensor {self.name} state determined as 'Open' due to inputState being 1." ) return "Open" + elif self._input_data["inputState"] == 2: + _logger.debug( + f"Sensor {self.name} state determined as 'Tamper' due to inputState being 2." + ) + return "Tamper" + elif self._input_data["inputState"] == 5: + _logger.debug( + f"Sensor {self.name} state determined as 'Inhibited' due to inputState being 5." + ) + return "Inhibited" else: _logger.debug(f"Sensor {self.name} state determined as 'Closed'.") return "Closed"