Fix state_class of huisbaasje sensors (#101892)

This commit is contained in:
Bouwe Westerdijk 2023-10-12 19:57:15 +02:00 committed by GitHub
parent 85af452c6e
commit 0c901435bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -146,7 +146,7 @@ SENSORS_INFO = [
translation_key="energy_today",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_DAY,
precision=1,
@ -156,7 +156,7 @@ SENSORS_INFO = [
translation_key="energy_week",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_WEEK,
precision=1,
@ -166,7 +166,7 @@ SENSORS_INFO = [
translation_key="energy_month",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_MONTH,
precision=1,
@ -176,7 +176,7 @@ SENSORS_INFO = [
translation_key="energy_year",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_YEAR,
precision=1,

View file

@ -224,7 +224,7 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
assert energy_today.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
energy_today.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
is SensorStateClass.TOTAL_INCREASING
)
assert (
energy_today.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
@ -240,7 +240,7 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
assert energy_this_week.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
energy_this_week.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
is SensorStateClass.TOTAL_INCREASING
)
assert (
energy_this_week.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
@ -256,7 +256,7 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
assert energy_this_month.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
energy_this_month.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
is SensorStateClass.TOTAL_INCREASING
)
assert (
energy_this_month.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
@ -272,7 +272,7 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
assert energy_this_year.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
energy_this_year.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
is SensorStateClass.TOTAL_INCREASING
)
assert (
energy_this_year.attributes.get(ATTR_UNIT_OF_MEASUREMENT)