Clean up smhi redundant code (#50765)

This commit is contained in:
Martin Hjelmare 2021-05-17 14:34:58 +02:00 committed by GitHub
parent 6b34ba012c
commit add594a44b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 8 deletions

View File

@ -2,12 +2,6 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
# Have to import for config_flow to work even if they are not used here
from .config_flow import smhi_locations # noqa: F401
from .const import DOMAIN # noqa: F401
DEFAULT_NAME = "smhi"
PLATFORMS = ["weather"]

View File

@ -21,7 +21,7 @@ from .const import DOMAIN, HOME_LOCATION_NAME
def smhi_locations(hass: HomeAssistant) -> set[str]:
"""Return configurations of SMHI component."""
return {
(slugify(entry.data[CONF_NAME]))
slugify(entry.data[CONF_NAME])
for entry in hass.config_entries.async_entries(DOMAIN)
}

View File

@ -12,4 +12,3 @@ DOMAIN = "smhi"
HOME_LOCATION_NAME = "Home"
ENTITY_ID_SENSOR_FORMAT = WEATHER_DOMAIN + ".smhi_{}"
ENTITY_ID_SENSOR_FORMAT_HOME = ENTITY_ID_SENSOR_FORMAT.format(HOME_LOCATION_NAME)