Fix OVO Energy reporting consumption as cost (#55856)

This commit is contained in:
deosrc 2021-09-30 11:31:06 +01:00 committed by GitHub
parent cf6398a949
commit d4ed0f9637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ SENSOR_TYPES_ELECTRICITY: tuple[OVOEnergySensorEntityDescription, ...] = (
name="OVO Last Electricity Cost",
device_class=DEVICE_CLASS_MONETARY,
state_class=STATE_CLASS_TOTAL_INCREASING,
value=lambda usage: usage.electricity[-1].consumption,
value=lambda usage: usage.electricity[-1].cost.amount,
),
OVOEnergySensorEntityDescription(
key="last_electricity_start_time",
@ -92,7 +92,7 @@ SENSOR_TYPES_GAS: tuple[OVOEnergySensorEntityDescription, ...] = (
device_class=DEVICE_CLASS_MONETARY,
state_class=STATE_CLASS_TOTAL_INCREASING,
icon="mdi:cash-multiple",
value=lambda usage: usage.gas[-1].consumption,
value=lambda usage: usage.gas[-1].cost.amount,
),
OVOEnergySensorEntityDescription(
key="last_gas_start_time",