mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
parent
2dddd31d97
commit
3647ada143
@ -99,12 +99,10 @@ class OVOEnergyEntity(CoordinatorEntity):
|
||||
self,
|
||||
coordinator: DataUpdateCoordinator,
|
||||
client: OVOEnergy,
|
||||
key: str,
|
||||
) -> None:
|
||||
"""Initialize the OVO Energy entity."""
|
||||
super().__init__(coordinator)
|
||||
self._client = client
|
||||
self._attr_unique_id = key
|
||||
|
||||
|
||||
class OVOEnergyDeviceEntity(OVOEnergyEntity):
|
||||
|
@ -57,7 +57,6 @@ SENSOR_TYPES_ELECTRICITY: tuple[OVOEnergySensorEntityDescription, ...] = (
|
||||
name="OVO Last Electricity Cost",
|
||||
device_class=DEVICE_CLASS_MONETARY,
|
||||
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||
icon="mdi:cash-multiple",
|
||||
value=lambda usage: usage.electricity[-1].consumption,
|
||||
),
|
||||
OVOEnergySensorEntityDescription(
|
||||
@ -157,8 +156,8 @@ class OVOEnergySensor(OVOEnergyDeviceEntity, SensorEntity):
|
||||
super().__init__(
|
||||
coordinator,
|
||||
client,
|
||||
f"{DOMAIN}_{client.account_id}_{description.key}",
|
||||
)
|
||||
self._attr_unique_id = f"{DOMAIN}_{client.account_id}_{description.key}"
|
||||
self.entity_description = description
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user