Skip to content

Commit 3c2f729

Browse files
authored
Fix Z-Wave generating name before setting entity description (home-assistant#156494)
1 parent 0d63cb7 commit 3c2f729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

homeassistant/components/zwave_js/entity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ def __init__(
7171
)
7272

7373
# Entity class attributes
74-
self._attr_name = self.generate_name()
75-
self._attr_unique_id = get_unique_id(driver, self.info.primary_value.value_id)
7674
if isinstance(info, NewZwaveDiscoveryInfo):
7775
self.entity_description = info.entity_description
7876
else:
7977
if (enabled_default := info.entity_registry_enabled_default) is False:
8078
self._attr_entity_registry_enabled_default = enabled_default
8179
if (entity_category := info.entity_category) is not None:
8280
self._attr_entity_category = entity_category
81+
self._attr_name = self.generate_name()
82+
self._attr_unique_id = get_unique_id(driver, self.info.primary_value.value_id)
8383
self._attr_assumed_state = self.info.assumed_state
8484
# device is precreated in main handler
8585
self._attr_device_info = DeviceInfo(

0 commit comments

Comments
 (0)