mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
fix flux_update service (#2792)
* fix flux_update service * fix tests * give update service unique name * remove unnecessary param * Revert "fix tests" This reverts commit 2fd7760455f5389b0de2e3ce272090c551d87201. * fix flux_update
This commit is contained in:
parent
f668a88485
commit
324ddfdaeb
@ -101,7 +101,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
"""Update lights."""
|
"""Update lights."""
|
||||||
flux.flux_update()
|
flux.flux_update()
|
||||||
|
|
||||||
hass.services.register(DOMAIN, 'flux_update', update)
|
hass.services.register(DOMAIN, name + '_update', update)
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=too-many-instance-attributes
|
||||||
@ -151,8 +151,10 @@ class FluxSwitch(SwitchDevice):
|
|||||||
self.update_ha_state()
|
self.update_ha_state()
|
||||||
|
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
def flux_update(self, now=dt_now()):
|
def flux_update(self, now=None):
|
||||||
"""Update all the lights using flux."""
|
"""Update all the lights using flux."""
|
||||||
|
if now is None:
|
||||||
|
now = dt_now()
|
||||||
sunset = next_setting(self.hass, SUN).replace(day=now.day,
|
sunset = next_setting(self.hass, SUN).replace(day=now.day,
|
||||||
month=now.month,
|
month=now.month,
|
||||||
year=now.year)
|
year=now.year)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user