OVO Energy - Post #54952 Cleanup (#55393)

This commit is contained in:
Aidan Timson 2021-08-29 04:31:07 +01:00 committed by GitHub
parent 2dddd31d97
commit 3647ada143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -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):

View File

@ -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