diff --git a/custom_components/saj_esolar/sensor.py b/custom_components/saj_esolar/sensor.py index 276fa00..97b4a95 100644 --- a/custom_components/saj_esolar/sensor.py +++ b/custom_components/saj_esolar/sensor.py @@ -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: @@ -1198,4 +1200,4 @@ async def async_update(self): # -Debug- adding sensor - _LOGGER.debug(f"Device: {self._type} State: {self._state}") \ No newline at end of file + _LOGGER.debug(f"Device: {self._type} State: {self._state}")