Skip to content

Commit

Permalink
Check is panel online
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST committed Dec 21, 2021
1 parent 2b7270d commit 7cff37a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/sector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def __init__(
self._lockdata: dict = {}
self._tempdata: dict = {}
self._switchdata: dict = {}
self._alarmstatus: str = ""
self._alarmstatus: int = 0
self._changed_by: str = ""
self.websession = websession
self._sector_temp = sector_temp
Expand Down Expand Up @@ -339,9 +339,10 @@ async def fetch_info(self, tempcheck: bool = True) -> None:
)
if response:
json_data = await response.json()
self._alarmstatus = json_data["Status"]
_LOGGER.debug("self._alarmstatus = %s", self._alarmstatus)
_LOGGER.debug("Full output panelstatus: %s", json_data)
if json_data["IsOnline"] is True:
self._alarmstatus = json_data["Status"]
_LOGGER.debug("self._alarmstatus = %s", self._alarmstatus)
_LOGGER.debug("Full output panelstatus: %s", json_data)

if self._temps and self._sector_temp and self._update_sensors:
response = await self._request(
Expand Down

0 comments on commit 7cff37a

Please sign in to comment.