From 82ac8372cc0734159cc0fc16d0b76b677f64f34c Mon Sep 17 00:00:00 2001 From: Dave Foster <113460294+FozzieUK@users.noreply.github.com> Date: Fri, 14 Apr 2023 11:47:58 +0100 Subject: [PATCH] Update sensor.py --- custom_components/foxess/sensor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_components/foxess/sensor.py b/custom_components/foxess/sensor.py index 5521c11..dd37257 100644 --- a/custom_components/foxess/sensor.py +++ b/custom_components/foxess/sensor.py @@ -141,7 +141,7 @@ async def async_update_data(): await getAddresbook(hass, headersData, allData, deviceID, username, hashedPassword,0) - if int(allData["addressbook"]["result"]["status"]) == 1 or int(allData["addressbook"]["result"]["status"]) == 2: + if int(allData["addressbook"]["result"]["status"]) == 1 or int(allData["addressbook"]["result"]["status"]) == 2 or int(allData["addressbook"]["result"]["status"]) == 3: allData["online"] = True await getRaw(hass, headersData, allData, deviceID) await getReport(hass, headersData, allData, deviceID) @@ -1442,7 +1442,10 @@ def native_value(self) -> str | None: if int(self.coordinator.data["addressbook"]["result"]["status"]) == 1: return "on-line" else: - return "off-line" + if int(self.coordinator.data["addressbook"]["result"]["status"]) == 2: + return "in-alarm" + else: + return "off-line" @property def extra_state_attributes(self):