mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +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."""
|
||||
super().__init__(coordinator)
|
||||
self._attr_unique_id = f"{config_entry.entry_id}_total_usage"
|
||||
self._name = SENSOR_NAME
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name of the sensor."""
|
||||
return f"{DEFAULT_NAME} {self._name}"
|
||||
self._attr_name = f"{DEFAULT_NAME} {SENSOR_NAME}"
|
||||
|
||||
@property
|
||||
def native_value(self) -> float:
|
||||
|
Loading…
x
Reference in New Issue
Block a user