Make Anova device unique id public (#99147)

This commit is contained in:
Joost Lekkerkerker 2023-08-27 20:10:08 +02:00 committed by GitHub
parent fbe2228c3f
commit c88672c352
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,7 @@ class AnovaCoordinator(DataUpdateCoordinator[APCUpdate]):
update_interval=timedelta(seconds=30),
)
assert self.config_entry is not None
self._device_unique_id = anova_device.device_key
self.device_unique_id = anova_device.device_key
self.anova_device = anova_device
self.device_info: DeviceInfo | None = None
@ -38,7 +38,7 @@ class AnovaCoordinator(DataUpdateCoordinator[APCUpdate]):
def async_setup(self, firmware_version: str) -> None:
"""Set the firmware version info."""
self.device_info = DeviceInfo(
identifiers={(DOMAIN, self._device_unique_id)},
identifiers={(DOMAIN, self.device_unique_id)},
name="Anova Precision Cooker",
manufacturer="Anova",
model="Precision Cooker",

View file

@ -28,4 +28,4 @@ class AnovaDescriptionEntity(AnovaEntity):
"""Initialize the entity and declare unique id based on description key."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator._device_unique_id}_{description.key}"
self._attr_unique_id = f"{coordinator.device_unique_id}_{description.key}"