Skip to content

Commit

Permalink
clean up logic
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Apr 26, 2023
1 parent 795f4d7 commit 826b44b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/nws_alerts/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
config.entry_id = slugify(f"{config.get(CONF_GPS_LOC)}")
elif CONF_TRACKER in config:
config.entry_id = slugify(f"{config.get(CONF_TRACKER)}")
elif all(key in config for key in [CONF_GPS_LOC, CONF_ZONE_ID, CONF_TRACKER]):
else:
raise ValueError("GPS, Zone or Device Tracker needs to be configured.")
config.data = config
else:
Expand All @@ -69,7 +69,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
config.entry_id = slugify(f"{config.get(CONF_GPS_LOC)}")
elif CONF_TRACKER in config:
config.entry_id = slugify(f"{config.get(CONF_TRACKER)}")
elif all(key in config for key in [CONF_GPS_LOC, CONF_ZONE_ID, CONF_TRACKER]):
else:
raise ValueError("GPS, Zone or Device Tracker needs to be configured.")
config.data = config

Expand Down

0 comments on commit 826b44b

Please sign in to comment.