From f3d9086ff4d2972a8839365db830841ff2e0e881 Mon Sep 17 00:00:00 2001 From: Jeff Wilson Date: Mon, 24 Jul 2017 02:53:03 -0400 Subject: [PATCH] Properly slugify switch.flux update service name (#8545) --- homeassistant/components/switch/flux.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/switch/flux.py b/homeassistant/components/switch/flux.py index dea4285e3a9..5613bcbb19e 100644 --- a/homeassistant/components/switch/flux.py +++ b/homeassistant/components/switch/flux.py @@ -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):