From a007835293b4ac9f7e066e103240fd573813545b Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Fri, 24 Jan 2020 23:42:59 -0700 Subject: [PATCH] Fix RainMachine update action (#31147) --- homeassistant/components/rainmachine/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index e2602e376a6..1e0421385ab 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -295,6 +295,10 @@ class RainMachine: 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 def async_deregister_api_interest(self, 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: self._async_unsub_dispatcher_connect = async_track_time_interval( self.hass, - self.async_update, + self._async_update_listener_action, timedelta(seconds=self._scan_interval_seconds), )