1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 22:18:40 +00:00

Remove last_reset attribute and set state class to total_increasing for mysensors energy sensors (#54827)

This commit is contained in:
Erik Montnemery
2021-08-18 16:58:13 +02:00
committed by GitHub
parent 9c7ea786a7
commit e98d50f6d1
2 changed files with 4 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ from homeassistant.components.sensor import (
ATTR_LAST_RESET,
ATTR_STATE_CLASS,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
)
from homeassistant.const import (
ATTR_DEVICE_CLASS,
@@ -24,7 +25,6 @@ from homeassistant.const import (
TEMP_FAHRENHEIT,
)
from homeassistant.core import HomeAssistant
from homeassistant.util.dt import utc_from_timestamp
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM, UnitSystem
from tests.common import MockConfigEntry
@@ -92,8 +92,7 @@ async def test_energy_sensor(
assert state.state == "18000"
assert state.attributes[ATTR_DEVICE_CLASS] == DEVICE_CLASS_ENERGY
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == ENERGY_KILO_WATT_HOUR
assert state.attributes[ATTR_STATE_CLASS] == STATE_CLASS_MEASUREMENT
assert state.attributes[ATTR_LAST_RESET] == utc_from_timestamp(0).isoformat()
assert state.attributes[ATTR_STATE_CLASS] == STATE_CLASS_TOTAL_INCREASING
async def test_sound_sensor(