Skip to content

Commit

Permalink
Revert "Use shorthand attributes in Telldus live" (#101281)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Oct 2, 2023
1 parent 1a9c98e commit 6fa3078
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion homeassistant/components/tellduslive/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -190,3 +189,8 @@ def native_value(self):
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)

0 comments on commit 6fa3078

Please sign in to comment.