Skip to content

Commit 7cff37a

Browse files
committed
Check is panel online
1 parent 2b7270d commit 7cff37a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

custom_components/sector/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def __init__(
187187
self._lockdata: dict = {}
188188
self._tempdata: dict = {}
189189
self._switchdata: dict = {}
190-
self._alarmstatus: str = ""
190+
self._alarmstatus: int = 0
191191
self._changed_by: str = ""
192192
self.websession = websession
193193
self._sector_temp = sector_temp
@@ -339,9 +339,10 @@ async def fetch_info(self, tempcheck: bool = True) -> None:
339339
)
340340
if response:
341341
json_data = await response.json()
342-
self._alarmstatus = json_data["Status"]
343-
_LOGGER.debug("self._alarmstatus = %s", self._alarmstatus)
344-
_LOGGER.debug("Full output panelstatus: %s", json_data)
342+
if json_data["IsOnline"] is True:
343+
self._alarmstatus = json_data["Status"]
344+
_LOGGER.debug("self._alarmstatus = %s", self._alarmstatus)
345+
_LOGGER.debug("Full output panelstatus: %s", json_data)
345346

346347
if self._temps and self._sector_temp and self._update_sensors:
347348
response = await self._request(

0 commit comments

Comments
 (0)