Add a comment why state_class=total (#99703)

pull/99710/head
tronikos 2023-09-05 23:43:46 -07:00 committed by GitHub
parent d523734db1
commit d4ef570b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -45,6 +45,7 @@ ELEC_SENSORS: tuple[OpowerEntityDescription, ...] = (
name="Current bill electric usage to date",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
# Not TOTAL_INCREASING because it can decrease for accounts with solar
state_class=SensorStateClass.TOTAL,
suggested_display_precision=0,
value_fn=lambda data: data.usage_to_date,