mirror of
https://github.com/Andre0512/hon.git
synced 2026-06-15 03:36:27 +00:00
Fix automatic updates of entities
This commit is contained in:
parent
7114a6578d
commit
0823793977
|
|
@ -346,4 +346,4 @@ class HonBinarySensorEntity(HonEntity, BinarySensorEntity):
|
|||
== self.entity_description.on_value
|
||||
)
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ class HonACClimateEntity(HonEntity, ClimateEntity):
|
|||
@callback
|
||||
def _handle_coordinator_update(self, update: bool = True) -> None:
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
|
||||
class HonClimateEntity(HonEntity, ClimateEntity):
|
||||
|
|
@ -423,4 +423,4 @@ class HonClimateEntity(HonEntity, ClimateEntity):
|
|||
@callback
|
||||
def _handle_coordinator_update(self, update: bool = True) -> None:
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -53,4 +53,4 @@ class HonEntity(CoordinatorEntity[DataUpdateCoordinator[dict[str, Any]]]):
|
|||
@callback
|
||||
def _handle_coordinator_update(self, update: bool = True) -> None:
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class HonFanEntity(HonEntity, FanEntity):
|
|||
)
|
||||
self._attr_percentage = self.percentage
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class HonLightEntity(HonEntity, LightEntity):
|
|||
self._attr_is_on = self.is_on
|
||||
self._attr_brightness = self.brightness
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
|
|
|||
|
|
@ -83,4 +83,4 @@ class HonLockEntity(HonEntity, LockEntity):
|
|||
def _handle_coordinator_update(self, update: bool = True) -> None:
|
||||
self._attr_is_locked = self.is_locked
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ class HonNumberEntity(HonEntity, NumberEntity):
|
|||
self._attr_native_step = setting.step
|
||||
self._attr_native_value = self.native_value
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
|
@ -324,4 +324,4 @@ class HonConfigNumberEntity(HonEntity, NumberEntity):
|
|||
self._attr_native_step = setting.step
|
||||
self._attr_native_value = self.native_value
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ class HonConfigSelectEntity(HonEntity, SelectEntity):
|
|||
self._attr_options = self.options
|
||||
self._attr_current_option = self.current_option
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
|
@ -334,4 +334,4 @@ class HonSelectEntity(HonEntity, SelectEntity):
|
|||
self._attr_options = self.options
|
||||
self._attr_current_option = self.current_option
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -846,7 +846,7 @@ class HonSensorEntity(HonEntity, SensorEntity):
|
|||
self._attr_native_value = 0
|
||||
self._attr_native_value = value
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
|
||||
class HonConfigSensorEntity(HonEntity, SensorEntity):
|
||||
|
|
@ -874,4 +874,4 @@ class HonConfigSensorEntity(HonEntity, SensorEntity):
|
|||
value = get_readable(self.entity_description, value)
|
||||
self._attr_native_value = value
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ class HonSwitchEntity(HonEntity, SwitchEntity):
|
|||
def _handle_coordinator_update(self, update: bool = True) -> None:
|
||||
self._attr_is_on = self.is_on
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
|
||||
class HonControlSwitchEntity(HonEntity, SwitchEntity):
|
||||
|
|
@ -556,4 +556,4 @@ class HonConfigSwitchEntity(HonEntity, SwitchEntity):
|
|||
def _handle_coordinator_update(self, update: bool = True) -> None:
|
||||
self._attr_is_on = self.is_on
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
|
|
|||
Loading…
Reference in a new issue