Skip to content

Commit

Permalink
Fix T5 actions error in some cases #1328
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Feb 13, 2024
1 parent aa88006 commit ba2ebc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/sonoff/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ def set_state(self, params: dict):
async def clear_state(self):
await asyncio.sleep(0.5)
self._attr_native_value = ""
self._async_write_ha_state()
if self.hass:
self._async_write_ha_state()


class XT5Action(XEntity, SensorEntity):
Expand All @@ -346,7 +347,8 @@ def set_state(self, params: dict):
async def clear_state(self):
await asyncio.sleep(0.5)
self._attr_native_value = ""
self._async_write_ha_state()
if self.hass:
self._async_write_ha_state()


class XUnknown(XEntity, SensorEntity):
Expand Down

0 comments on commit ba2ebc7

Please sign in to comment.