Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
atualizando  async_write_ha_state() para schedule_update_ha_state()
  • Loading branch information
fernac03 authored May 4, 2024
1 parent f4c1703 commit d1290eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ async def async_added_to_hass(self):
def _message_callback(self, message):
if message.alarm_sounding:
self._attr_is_on = True
self.async_write_ha_state()
self.schedule_update_ha_state()
else:
self._attr_is_on = False
self.async_write_ha_state()
self.schedule_update_ha_state()

async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the entity on."""
Expand Down Expand Up @@ -156,4 +156,4 @@ def _message_callback(self, message):
self.schedule_update_ha_state()
else:
self._attr_native_value = False
self.schedule_update_ha_state()
self.schedule_update_ha_state()

0 comments on commit d1290eb

Please sign in to comment.