# Buggy code
async def async_setup(hass, config):
    """Setup configured zones as well as home assistant zone if necessary."""
    if DOMAIN not in hass.data:
        hass.data[DOMAIN] = {}
    zone_entries = configured_zones(hass)
    for _, entry in config_per_platform(config, DOMAIN):
        name = slugify(entry[CONF_NAME])
        if name not in zone_entries:
            zone = Zone(
                hass,
                entry[CONF_NAME],
                entry[CONF_LATITUDE],
                entry[CONF_LONGITUDE],
                entry.get(CONF_RADIUS),
                entry.get(CONF_ICON),
                entry.get(CONF_PASSIVE),
            )
            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

    if HOME_ZONE not in hass.data[DOMAIN] and HOME_ZONE not in zone_entries:
        name = hass.config.location_name
        zone = Zone(
            hass,
            name,
            hass.config.latitude,
            hass.config.longitude,
            DEFAULT_RADIUS,
            ICON_HOME,
            False,
        )
        zone.entity_id = ENTITY_ID_HOME
        hass.async_add_job(zone.async_update_ha_state())
        hass.data[DOMAIN][slugify(name)] = zone

    return True


# Traceback (TypeError)
Error during setup of component zone
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
result = await component.async_setup(hass, processed_config)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/zone/__init__.py", line 68, in async_setup
hass.data[DOMAIN][slugify(name)] = zone
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 43, in slugify
text = normalize('NFKD', text)
TypeError: normalize() argument 2 must be str, not None

# Fixed code
async def async_setup(hass, config):
    """Setup configured zones as well as home assistant zone if necessary."""
    hass.data[DOMAIN] = {}
    entities = set()
    zone_entries = configured_zones(hass)
    for _, entry in config_per_platform(config, DOMAIN):
        if slugify(entry[CONF_NAME]) not in zone_entries:
            zone = Zone(
                hass,
                entry[CONF_NAME],
                entry[CONF_LATITUDE],
                entry[CONF_LONGITUDE],
                entry.get(CONF_RADIUS),
                entry.get(CONF_ICON),
                entry.get(CONF_PASSIVE),
            )
            zone.entity_id = async_generate_entity_id(
                ENTITY_ID_FORMAT, entry[CONF_NAME], entities
            )
            hass.async_add_job(zone.async_update_ha_state())
            entities.add(zone.entity_id)

    if ENTITY_ID_HOME not in entities and HOME_ZONE not in zone_entries:
        zone = Zone(
            hass,
            hass.config.location_name,
            hass.config.latitude,
            hass.config.longitude,
            DEFAULT_RADIUS,
            ICON_HOME,
            False,
        )
        zone.entity_id = ENTITY_ID_HOME
        hass.async_add_job(zone.async_update_ha_state())

    return True