Make initial flux update directly when turning on (#5266)

pull/5183/head^2
Teemu R 2017-01-17 07:53:34 +01:00 committed by Paulus Schoutsen
parent bae38ac17b
commit d62b1fc808
1 changed files with 2 additions and 0 deletions

View File

@ -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])