Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion homeassistant/components/zone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ async def async_setup(hass, config):
zone.entity_id = async_generate_entity_id(
ENTITY_ID_FORMAT, entry[CONF_NAME], None, hass)
hass.async_add_job(zone.async_update_ha_state())
hass.data[DOMAIN][name] = zone
hass.data[DOMAIN][slugify(name)] = zone

if HOME_ZONE not in hass.data[DOMAIN] and HOME_ZONE not in zone_entries:
name = hass.config.location_name
if name is None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible apply a proper default to location_name?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is hass own parameter. This is how the old logic worked. I just missed this use case

name = HOME_ZONE
zone = Zone(hass, name, hass.config.latitude, hass.config.longitude,
DEFAULT_RADIUS, ICON_HOME, False)
zone.entity_id = ENTITY_ID_HOME
Expand Down