Skip to content

Commit

Permalink
Add update_without_throttle to ecobee number (home-assistant#116504)
Browse files Browse the repository at this point in the history
add update_without_throttle
  • Loading branch information
marcolivierarsenault authored May 10, 2024
1 parent 8168aff commit db6e3f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homeassistant/components/ecobee/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,20 @@ def __init__(
super().__init__(data, thermostat_index)
self.entity_description = description
self._attr_unique_id = f"{self.base_unique_id}_ventilator_{description.key}"
self.update_without_throttle = False

async def async_update(self) -> None:
"""Get the latest state from the thermostat."""
await self.data.update()
if self.update_without_throttle:
await self.data.update(no_throttle=True)
self.update_without_throttle = False
else:
await self.data.update()
self._attr_native_value = self.thermostat["settings"][
self.entity_description.ecobee_setting_key
]

def set_native_value(self, value: float) -> None:
"""Set new ventilator Min On Time value."""
self.entity_description.set_fn(self.data, self.thermostat_index, int(value))
self.update_without_throttle = True

0 comments on commit db6e3f7

Please sign in to comment.