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, self,
coordinator: DataUpdateCoordinator, coordinator: DataUpdateCoordinator,
client: OVOEnergy, client: OVOEnergy,
key: str,
) -> None: ) -> None:
"""Initialize the OVO Energy entity.""" """Initialize the OVO Energy entity."""
super().__init__(coordinator) super().__init__(coordinator)
self._client = client self._client = client
self._attr_unique_id = key
class OVOEnergyDeviceEntity(OVOEnergyEntity): class OVOEnergyDeviceEntity(OVOEnergyEntity):

View File

@ -57,7 +57,6 @@ SENSOR_TYPES_ELECTRICITY: tuple[OVOEnergySensorEntityDescription, ...] = (
name="OVO Last Electricity Cost", name="OVO Last Electricity Cost",
device_class=DEVICE_CLASS_MONETARY, device_class=DEVICE_CLASS_MONETARY,
state_class=STATE_CLASS_TOTAL_INCREASING, state_class=STATE_CLASS_TOTAL_INCREASING,
icon="mdi:cash-multiple",
value=lambda usage: usage.electricity[-1].consumption, value=lambda usage: usage.electricity[-1].consumption,
), ),
OVOEnergySensorEntityDescription( OVOEnergySensorEntityDescription(
@ -157,8 +156,8 @@ class OVOEnergySensor(OVOEnergyDeviceEntity, SensorEntity):
super().__init__( super().__init__(
coordinator, coordinator,
client, client,
f"{DOMAIN}_{client.account_id}_{description.key}",
) )
self._attr_unique_id = f"{DOMAIN}_{client.account_id}_{description.key}"
self.entity_description = description self.entity_description = description
@property @property