mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Properly slugify switch.flux update service name (#8545)
This commit is contained in:
parent
b0b6026c68
commit
f3d9086ff4
@ -15,6 +15,7 @@ from homeassistant.components.switch import DOMAIN, SwitchDevice
|
|||||||
from homeassistant.const import CONF_NAME, CONF_PLATFORM
|
from homeassistant.const import CONF_NAME, CONF_PLATFORM
|
||||||
from homeassistant.helpers.event import track_time_change
|
from homeassistant.helpers.event import track_time_change
|
||||||
from homeassistant.helpers.sun import get_astral_event_date
|
from homeassistant.helpers.sun import get_astral_event_date
|
||||||
|
from homeassistant.util import slugify
|
||||||
from homeassistant.util.color import (
|
from homeassistant.util.color import (
|
||||||
color_temperature_to_rgb, color_RGB_to_xy,
|
color_temperature_to_rgb, color_RGB_to_xy,
|
||||||
color_temperature_kelvin_to_mired)
|
color_temperature_kelvin_to_mired)
|
||||||
@ -111,7 +112,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
"""Update lights."""
|
"""Update lights."""
|
||||||
flux.flux_update()
|
flux.flux_update()
|
||||||
|
|
||||||
hass.services.register(DOMAIN, name + '_update', update)
|
service_name = slugify("{} {}".format(name, 'update'))
|
||||||
|
hass.services.register(DOMAIN, service_name, update)
|
||||||
|
|
||||||
|
|
||||||
class FluxSwitch(SwitchDevice):
|
class FluxSwitch(SwitchDevice):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user