Fix entity cleanup and naming bugs in ISY994 (#86023)

This commit is contained in:
shbatm 2023-01-16 12:43:42 -06:00 committed by GitHub
parent 6a89b3a135
commit b229347625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ async def async_setup_entry(
ISYNodeQueryButtonEntity( ISYNodeQueryButtonEntity(
node=isy, node=isy,
name="Query", name="Query",
unique_id=isy.uuid, unique_id=f"{isy.uuid}_query",
device_info=DeviceInfo(identifiers={(DOMAIN, isy.uuid)}), device_info=DeviceInfo(identifiers={(DOMAIN, isy.uuid)}),
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
) )

View File

@ -94,7 +94,7 @@ class ISYNodeEntity(ISYEntity):
) -> None: ) -> None:
"""Initialize the ISY/IoX node entity.""" """Initialize the ISY/IoX node entity."""
super().__init__(node, device_info=device_info) super().__init__(node, device_info=device_info)
if node.address == node.primary_node: if hasattr(node, "parent_node") and node.parent_node is None:
self._attr_has_entity_name = True self._attr_has_entity_name = True
self._attr_name = None self._attr_name = None