mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Use shorthand attributes in SRP Energy (#99881)
This commit is contained in:
parent
92628ea068
commit
432894a401
@ -40,12 +40,7 @@ class SrpEntity(CoordinatorEntity[SRPEnergyDataUpdateCoordinator], SensorEntity)
|
|||||||
"""Initialize the SrpEntity class."""
|
"""Initialize the SrpEntity class."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._attr_unique_id = f"{config_entry.entry_id}_total_usage"
|
self._attr_unique_id = f"{config_entry.entry_id}_total_usage"
|
||||||
self._name = SENSOR_NAME
|
self._attr_name = f"{DEFAULT_NAME} {SENSOR_NAME}"
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self) -> str:
|
|
||||||
"""Return the name of the sensor."""
|
|
||||||
return f"{DEFAULT_NAME} {self._name}"
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self) -> float:
|
def native_value(self) -> float:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user