Remove platform from unique ID in Nice G.O. (#124548)
* Remove domain from unique ID in Nice G.O. * Snapshotspull/124584/head
parent
7c8e00e5e0
commit
fcf0bef2cd
|
@ -25,7 +25,7 @@ async def async_setup_entry(
|
|||
coordinator = config_entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
NiceGOCoverEntity(coordinator, device_id, device_data.name, "cover")
|
||||
NiceGOCoverEntity(coordinator, device_id, device_data.name)
|
||||
for device_id, device_data in coordinator.data.items()
|
||||
)
|
||||
|
||||
|
|
|
@ -17,12 +17,11 @@ class NiceGOEntity(CoordinatorEntity[NiceGOUpdateCoordinator]):
|
|||
coordinator: NiceGOUpdateCoordinator,
|
||||
device_id: str,
|
||||
device_name: str,
|
||||
sub_device_id: str,
|
||||
) -> None:
|
||||
"""Initialize the entity."""
|
||||
super().__init__(coordinator)
|
||||
|
||||
self._attr_unique_id = f"{device_id}-{sub_device_id}"
|
||||
self._attr_unique_id = device_id
|
||||
self._device_id = device_id
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, device_id)},
|
||||
|
|
|
@ -23,7 +23,7 @@ async def async_setup_entry(
|
|||
coordinator = config_entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
NiceGOEventEntity(coordinator, device_id, device_data.name, "event")
|
||||
NiceGOEventEntity(coordinator, device_id, device_data.name)
|
||||
for device_id, device_data in coordinator.data.items()
|
||||
)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ async def async_setup_entry(
|
|||
coordinator = config_entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
NiceGOLightEntity(coordinator, device_id, device_data.name, "light")
|
||||
NiceGOLightEntity(coordinator, device_id, device_data.name)
|
||||
for device_id, device_data in coordinator.data.items()
|
||||
)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ async def async_setup_entry(
|
|||
coordinator = config_entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
NiceGOSwitchEntity(coordinator, device_id, device_data.name, "switch")
|
||||
NiceGOSwitchEntity(coordinator, device_id, device_data.name)
|
||||
for device_id, device_data in coordinator.data.items()
|
||||
)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
'previous_unique_id': None,
|
||||
'supported_features': <CoverEntityFeature: 3>,
|
||||
'translation_key': None,
|
||||
'unique_id': '1-cover',
|
||||
'unique_id': '1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
|
@ -76,7 +76,7 @@
|
|||
'previous_unique_id': None,
|
||||
'supported_features': <CoverEntityFeature: 3>,
|
||||
'translation_key': None,
|
||||
'unique_id': '2-cover',
|
||||
'unique_id': '2',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'light',
|
||||
'unique_id': '1-light',
|
||||
'unique_id': '1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
|
@ -87,7 +87,7 @@
|
|||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'light',
|
||||
'unique_id': '2-light',
|
||||
'unique_id': '2',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
|
|
Loading…
Reference in New Issue