From fd533e46ddf523bbf65c686dbe761ea5eb1a973b Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Tue, 9 Jan 2024 14:08:58 +0100 Subject: [PATCH] Correct state class in `mobile_app` tests (#107646) Correct right state class in `mobile_app` tests --- tests/components/mobile_app/test_sensor.py | 8 ++++---- tests/components/mobile_app/test_webhook.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/components/mobile_app/test_sensor.py b/tests/components/mobile_app/test_sensor.py index f7c4a5690db..c1414533fd7 100644 --- a/tests/components/mobile_app/test_sensor.py +++ b/tests/components/mobile_app/test_sensor.py @@ -53,7 +53,7 @@ async def test_sensor( "type": "sensor", "entity_category": "diagnostic", "unique_id": "battery_temp", - "state_class": "total", + "state_class": "measurement", "unit_of_measurement": UnitOfTemperature.CELSIUS, }, }, @@ -73,7 +73,7 @@ async def test_sensor( # unit of temperature sensor is automatically converted to the system UoM assert entity.attributes["unit_of_measurement"] == state_unit assert entity.attributes["foo"] == "bar" - assert entity.attributes["state_class"] == "total" + assert entity.attributes["state_class"] == "measurement" assert entity.domain == "sensor" assert entity.name == "Test 1 Battery Temperature" assert entity.state == state1 @@ -175,7 +175,7 @@ async def test_sensor_migration( "type": "sensor", "entity_category": "diagnostic", "unique_id": unique_id, - "state_class": "total", + "state_class": "measurement", "unit_of_measurement": UnitOfTemperature.CELSIUS, }, }, @@ -195,7 +195,7 @@ async def test_sensor_migration( # unit of temperature sensor is automatically converted to the system UoM assert entity.attributes["unit_of_measurement"] == state_unit assert entity.attributes["foo"] == "bar" - assert entity.attributes["state_class"] == "total" + assert entity.attributes["state_class"] == "measurement" assert entity.domain == "sensor" assert entity.name == "Test 1 Battery Temperature" assert entity.state == state1 diff --git a/tests/components/mobile_app/test_webhook.py b/tests/components/mobile_app/test_webhook.py index 6fe272fbc40..c5e5801cda8 100644 --- a/tests/components/mobile_app/test_webhook.py +++ b/tests/components/mobile_app/test_webhook.py @@ -962,7 +962,7 @@ async def test_reregister_sensor( "state": 100, "type": "sensor", "unique_id": "abcd", - "state_class": "total", + "state_class": "measurement", "device_class": "battery", "entity_category": "diagnostic", "icon": "mdi:new-icon",