Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FozzieUK authored Apr 14, 2023
1 parent 2972057 commit 82ac837
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/foxess/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 82ac837

Please sign in to comment.