Skip to content

Commit

Permalink
Fix for frozen entity_description in 2024.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbruckner committed Dec 28, 2023
1 parent 1e3e530 commit 9892505
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/entity_tz/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,15 @@ def __init__(
sources: Container[ETZSource],
) -> None:
"""Initialize sensor entity."""
self.entity_description = entity_description
self._attr_device_info = DeviceInfo(
entry_type=DeviceEntryType.SERVICE,
identifiers={(DOMAIN, entry.entry_id)},
name=entry.title,
)
key = entity_description.key
enable = _enable_entity(key, entry.data)
entity_description.entity_registry_enabled_default = enable
entity_description.translation_key = key
self.entity_description = entity_description
self._attr_entity_registry_enabled_default = _enable_entity(key, entry.data)
self._attr_translation_key = key
self._attr_unique_id = f"{entry.entry_id}-{key}"
self._sources = sources
if ETZSource.LOC in sources:
Expand Down

0 comments on commit 9892505

Please sign in to comment.