mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +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."""
|
"""Initialise the gauge with a data instance and station."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self.key = key
|
self.key = key
|
||||||
|
self._attr_unique_id = key
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def station_name(self):
|
def station_name(self):
|
||||||
@ -126,11 +127,6 @@ class Measurement(CoordinatorEntity, SensorEntity):
|
|||||||
"""Return the name of the gauge."""
|
"""Return the name of the gauge."""
|
||||||
return f"{self.station_name} {self.parameter_name} {self.qualifier}"
|
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
|
@property
|
||||||
def device_info(self):
|
def device_info(self):
|
||||||
"""Return the device info."""
|
"""Return the device info."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user