From cee0440ab69aecf3a8aaf262a6820c1930368c91 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 27 Dec 2021 23:14:43 +0100 Subject: [PATCH] Add unique ID to PVOutput entities (#62890) --- homeassistant/components/pvoutput/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/pvoutput/sensor.py b/homeassistant/components/pvoutput/sensor.py index 1cae6e53e67..5f3765c688e 100644 --- a/homeassistant/components/pvoutput/sensor.py +++ b/homeassistant/components/pvoutput/sensor.py @@ -115,6 +115,7 @@ async def async_setup_entry( PVOutputSensorEntity( coordinator=coordinator, description=description, + system_id=entry.data[CONF_SYSTEM_ID], ) for description in SENSORS ) @@ -131,10 +132,12 @@ class PVOutputSensorEntity(CoordinatorEntity, SensorEntity): *, coordinator: DataUpdateCoordinator, description: PVOutputSensorEntityDescription, + system_id: str, ) -> None: """Initialize a PVOutput sensor.""" super().__init__(coordinator=coordinator) self.entity_description = description + self._attr_unique_id = f"{system_id}_{description.key}" @property def native_value(self) -> int | float | None: