mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Make initial flux update directly when turning on (#5266)
This commit is contained in:
parent
bae38ac17b
commit
d62b1fc808
@ -134,6 +134,8 @@ class FluxSwitch(SwitchDevice):
|
|||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
"""Turn on flux."""
|
"""Turn on flux."""
|
||||||
|
if not self._state: # make initial update
|
||||||
|
self.flux_update()
|
||||||
self._state = True
|
self._state = True
|
||||||
self.unsub_tracker = track_utc_time_change(self.hass, self.flux_update,
|
self.unsub_tracker = track_utc_time_change(self.hass, self.flux_update,
|
||||||
second=[0, 30])
|
second=[0, 30])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user