mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Use shorthand attribute for EAFM (#95233)
This commit is contained in:
parent
9e3706e3b9
commit
a64940cf42
@ -100,6 +100,7 @@ class Measurement(CoordinatorEntity, SensorEntity):
|
||||
"""Initialise the gauge with a data instance and station."""
|
||||
super().__init__(coordinator)
|
||||
self.key = key
|
||||
self._attr_unique_id = key
|
||||
|
||||
@property
|
||||
def station_name(self):
|
||||
@ -126,11 +127,6 @@ class Measurement(CoordinatorEntity, SensorEntity):
|
||||
"""Return the name of the gauge."""
|
||||
return f"{self.station_name} {self.parameter_name} {self.qualifier}"
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return the unique id of the gauge."""
|
||||
return self.key
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return the device info."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user