Skip to content

Commit

Permalink
add Error state to runningState
Browse files Browse the repository at this point in the history
the entity runningState has a new value Error when runningState is 2
  • Loading branch information
djansen1987 authored Aug 29, 2023
1 parent 8837646 commit f754252
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/saj_esolar/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,10 @@ async def async_update(self):
if energy['plantDetail']["runningState"] is not None:
if int(energy['plantDetail']["runningState"]) is 0:
self._state = "No"
else:
elif int(energy['plantDetail']["runningState"]) is 1
self._state = "Yes"
else:
self._state = "Error"
if self._type == 'todayElectricity':
if 'todayElectricity' in energy['plantDetail']:
if energy['plantDetail']["todayElectricity"] is not None:
Expand Down Expand Up @@ -1198,4 +1200,4 @@ async def async_update(self):


# -Debug- adding sensor
_LOGGER.debug(f"Device: {self._type} State: {self._state}")
_LOGGER.debug(f"Device: {self._type} State: {self._state}")

0 comments on commit f754252

Please sign in to comment.