From 49284fb469ee889d271b8f0c95348634ccbad119 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sat, 6 Jan 2024 00:33:04 +0100 Subject: [PATCH] Fix duplicate unique_ids in emonitor (#107320) --- homeassistant/components/emonitor/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/emonitor/sensor.py b/homeassistant/components/emonitor/sensor.py index 5600cca308e..1c3011ee28d 100644 --- a/homeassistant/components/emonitor/sensor.py +++ b/homeassistant/components/emonitor/sensor.py @@ -15,7 +15,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.typing import UNDEFINED, StateType +from homeassistant.helpers.typing import StateType from homeassistant.helpers.update_coordinator import ( CoordinatorEntity, DataUpdateCoordinator, @@ -83,7 +83,7 @@ class EmonitorPowerSensor(CoordinatorEntity, SensorEntity): mac_address = self.emonitor_status.network.mac_address device_name = name_short_mac(mac_address[-6:]) label = self.channel_data.label or str(channel_number) - if description.name is not UNDEFINED: + if description.translation_key is not None: self._attr_translation_placeholders = {"label": label} self._attr_unique_id = f"{mac_address}_{channel_number}_{description.key}" else: