mirror of
https://github.com/home-assistant/core.git
synced 2025-05-21 14:27:07 +00:00
Fix state classes for ovo energy sensors (#116225)
* Fix state classes for ovo energy sensors * Restore monetary values Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> --------- Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
2861ac4ac9
commit
e9c4185cf6
@ -54,7 +54,7 @@ SENSOR_TYPES_ELECTRICITY: tuple[OVOEnergySensorEntityDescription, ...] = (
|
||||
key=KEY_LAST_ELECTRICITY_COST,
|
||||
translation_key=KEY_LAST_ELECTRICITY_COST,
|
||||
device_class=SensorDeviceClass.MONETARY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
value=lambda usage: usage.electricity[-1].cost.amount
|
||||
if usage.electricity[-1].cost is not None
|
||||
else None,
|
||||
@ -88,7 +88,7 @@ SENSOR_TYPES_GAS: tuple[OVOEnergySensorEntityDescription, ...] = (
|
||||
key=KEY_LAST_GAS_COST,
|
||||
translation_key=KEY_LAST_GAS_COST,
|
||||
device_class=SensorDeviceClass.MONETARY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
value=lambda usage: usage.gas[-1].cost.amount
|
||||
if usage.gas[-1].cost is not None
|
||||
else None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user