Fix RainMachine update action (#31147)

This commit is contained in:
Aaron Bach 2020-01-24 23:42:59 -07:00 committed by GitHub
parent 550aa6a0a5
commit a007835293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,6 +295,10 @@ class RainMachine:
return data return data
async def _async_update_listener_action(self, now):
"""Define an async_track_time_interval action to update data."""
await self.async_update()
@callback @callback
def async_deregister_api_interest(self, api_category): def async_deregister_api_interest(self, api_category):
"""Decrement the number of entities with data needs from an API category.""" """Decrement the number of entities with data needs from an API category."""
@ -313,7 +317,7 @@ class RainMachine:
if not self._async_unsub_dispatcher_connect: if not self._async_unsub_dispatcher_connect:
self._async_unsub_dispatcher_connect = async_track_time_interval( self._async_unsub_dispatcher_connect = async_track_time_interval(
self.hass, self.hass,
self.async_update, self._async_update_listener_action,
timedelta(seconds=self._scan_interval_seconds), timedelta(seconds=self._scan_interval_seconds),
) )