From d62b1fc8085d2d58a4e976a5c74833c9c6f97cf7 Mon Sep 17 00:00:00 2001 From: Teemu R Date: Tue, 17 Jan 2017 07:53:34 +0100 Subject: [PATCH] Make initial flux update directly when turning on (#5266) --- homeassistant/components/switch/flux.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/switch/flux.py b/homeassistant/components/switch/flux.py index 9fccf75ea4f..75ecc30c823 100644 --- a/homeassistant/components/switch/flux.py +++ b/homeassistant/components/switch/flux.py @@ -134,6 +134,8 @@ class FluxSwitch(SwitchDevice): def turn_on(self, **kwargs): """Turn on flux.""" + if not self._state: # make initial update + self.flux_update() self._state = True self.unsub_tracker = track_utc_time_change(self.hass, self.flux_update, second=[0, 30])