From 5910161202bec39bc62c6d047d5445603b34d7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Hellstr=C3=B6m?= Date: Tue, 30 Oct 2018 10:44:07 +0100 Subject: [PATCH] fix naming bug (#17976) --- homeassistant/components/weather/smhi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/weather/smhi.py b/homeassistant/components/weather/smhi.py index 3bbaab3f8ec..41ac1571339 100644 --- a/homeassistant/components/weather/smhi.py +++ b/homeassistant/components/weather/smhi.py @@ -19,7 +19,7 @@ from homeassistant.const import ( CONF_NAME, TEMP_CELSIUS) from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client -from homeassistant.util import dt, Throttle +from homeassistant.util import dt, slugify, Throttle from homeassistant.components.weather import ( WeatherEntity, ATTR_FORECAST_CONDITION, ATTR_FORECAST_TEMP, @@ -73,11 +73,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entries) -> bool: """Add a weather entity from map location.""" location = config_entry.data - name = location[CONF_NAME] + name = slugify(location[CONF_NAME]) session = aiohttp_client.async_get_clientsession(hass) - entity = SmhiWeather(name, location[CONF_LATITUDE], + entity = SmhiWeather(location[CONF_NAME], location[CONF_LATITUDE], location[CONF_LONGITUDE], session=session) entity.entity_id = ENTITY_ID_SENSOR_FORMAT.format(name)