Skip to content

Commit

Permalink
Merge pull request #155 from FozzieUK/main
Browse files Browse the repository at this point in the history
Small update to allow data to be fetched when the plant is off-line and correctly updates inverter status
  • Loading branch information
macxq authored Apr 17, 2023
2 parents 2972057 + 82ac837 commit d5ac830
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 d5ac830

Please sign in to comment.