From 6fa3078cfca6833cbb5e60f5471a80afc1ce547a Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 2 Oct 2023 19:10:15 +0200 Subject: [PATCH] Revert "Use shorthand attributes in Telldus live" (#101281) --- homeassistant/components/tellduslive/sensor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tellduslive/sensor.py b/homeassistant/components/tellduslive/sensor.py index 06b505d9574..e15f89888b1 100644 --- a/homeassistant/components/tellduslive/sensor.py +++ b/homeassistant/components/tellduslive/sensor.py @@ -142,7 +142,6 @@ class TelldusLiveSensor(TelldusLiveEntity, SensorEntity): def __init__(self, client, device_id): """Initialize TelldusLiveSensor.""" super().__init__(client, device_id) - self._attr_unique_id = "{}-{}-{}".format(*device_id) if desc := SENSOR_TYPES.get(self._type): self.entity_description = desc else: @@ -190,3 +189,8 @@ class TelldusLiveSensor(TelldusLiveEntity, SensorEntity): if self._type == SENSOR_TYPE_LUMINANCE: return self._value_as_luminance return self._value + + @property + def unique_id(self) -> str: + """Return a unique ID.""" + return "{}-{}-{}".format(*self._id)