Use entry ID when IPP printer offers no identifier (#34316)

This commit is contained in:
Chris Talkington authored and GitHub committed 2020-04-30 00:21:53 -07:00
1 parent f3c6f665af
commit b4083dc14f
4 files changed
+50 -19

No files matched your search

+2 -6
View File
@@ -128,24 +128,20 @@ class IPPEntity(Entity):
self,
*,
entry_id: str,
device_id: str,
coordinator: IPPDataUpdateCoordinator,
name: str,
icon: str,
enabled_default: bool = True,
) -> None:
"""Initialize the IPP entity."""
self._device_id = None
self._device_id = device_id
self._enabled_default = enabled_default
self._entry_id = entry_id
self._icon = icon
self._name = name
self.coordinator = coordinator
if coordinator.data.info.uuid is not None:
self._device_id = coordinator.data.info.uuid
elif coordinator.data.info.serial is not None:
self._device_id = coordinator.data.info.serial
@property
def name(self) -> str:
"""Return the name of the entity."""