Properly slugify switch.flux update service name (#8545)

pull/8627/head
Jeff Wilson 2017-07-24 02:53:03 -04:00 committed by Paulus Schoutsen
parent b0b6026c68
commit f3d9086ff4
1 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,7 @@ from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.const import CONF_NAME, CONF_PLATFORM
from homeassistant.helpers.event import track_time_change
from homeassistant.helpers.sun import get_astral_event_date
from homeassistant.util import slugify
from homeassistant.util.color import (
color_temperature_to_rgb, color_RGB_to_xy,
color_temperature_kelvin_to_mired)
@ -111,7 +112,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
"""Update lights."""
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):