The ADS sensor component pushes its state every time it detects a change.
Is it possible to limit this in time? Example, once every 10 seconds?
def async_added_to_hass(self):
"""Register device notification."""
def update(name, value):
"""Handle device notifications."""
_LOGGER.debug("Variable %s changed its value to %d", name, value)
# If factor is set use it otherwise not
if self.factor is None:
self._value = value
else:
self._value = value / self.factor
self.schedule_update_ha_state()
self.hass.async_add_job(
self._ads_hub.add_device_notification,
self.ads_var, self._ads_hub.ADS_TYPEMAP[self.ads_type], update
)
I know it has something to do with the self.schedule_update_ha_state(), but since I’m new to this I don’t know how to implement a SCAN_INTERVAL here.