Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Aug 13, 2022
1 parent 132a22a commit e908f53
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions custom_components/powercalc/sensors/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,9 @@ async def update_associated_group_entry(hass: HomeAssistant, config_entry: Confi
group_entry = hass.config_entries.async_get_entry(group_entry_id)
member_sensors = group_entry.data.get(CONF_GROUP_MEMBER_SENSORS) or []

if remove:
if not config_entry.entry_id in member_sensors:
return None
if remove and config_entry.entry_id in member_sensors:
member_sensors.remove(config_entry.entry_id)
else:
if config_entry.entry_id in member_sensors:
return None
elif config_entry.entry_id not in member_sensors:
member_sensors.append(config_entry.entry_id)

hass.config_entries.async_update_entry(
Expand Down

0 comments on commit e908f53

Please sign in to comment.