Skip to content

Commit

Permalink
Prevent adding group to it's own group (#1918)
Browse files Browse the repository at this point in the history
* fix: set device class to energy on startup

* Prevent adding group to it's own group
  • Loading branch information
bramstroker committed Nov 18, 2023
1 parent 9d79403 commit 05d6c16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/powercalc/sensors/group.py
Expand Up @@ -455,6 +455,8 @@ def __init__(
unique_id: str | None = None,
) -> None:
self._attr_name = name
# Remove own entity from entities, when it happens to be there. To prevent recursion
entities.discard(entity_id)
self._entities = entities
if not sensor_config.get(CONF_DISABLE_EXTENDED_ATTRIBUTES):
self._attr_extra_state_attributes = {
Expand Down

0 comments on commit 05d6c16

Please sign in to comment.