Correct state class in mobile_app tests (#107646)

Correct right state class in `mobile_app` tests
This commit is contained in:
Jan-Philipp Benecke 2024-01-09 14:08:58 +01:00 committed by GitHub
parent c9d0134b8b
commit fd533e46dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ async def test_sensor(
"type": "sensor", "type": "sensor",
"entity_category": "diagnostic", "entity_category": "diagnostic",
"unique_id": "battery_temp", "unique_id": "battery_temp",
"state_class": "total", "state_class": "measurement",
"unit_of_measurement": UnitOfTemperature.CELSIUS, "unit_of_measurement": UnitOfTemperature.CELSIUS,
}, },
}, },
@ -73,7 +73,7 @@ async def test_sensor(
# unit of temperature sensor is automatically converted to the system UoM # unit of temperature sensor is automatically converted to the system UoM
assert entity.attributes["unit_of_measurement"] == state_unit assert entity.attributes["unit_of_measurement"] == state_unit
assert entity.attributes["foo"] == "bar" assert entity.attributes["foo"] == "bar"
assert entity.attributes["state_class"] == "total" assert entity.attributes["state_class"] == "measurement"
assert entity.domain == "sensor" assert entity.domain == "sensor"
assert entity.name == "Test 1 Battery Temperature" assert entity.name == "Test 1 Battery Temperature"
assert entity.state == state1 assert entity.state == state1
@ -175,7 +175,7 @@ async def test_sensor_migration(
"type": "sensor", "type": "sensor",
"entity_category": "diagnostic", "entity_category": "diagnostic",
"unique_id": unique_id, "unique_id": unique_id,
"state_class": "total", "state_class": "measurement",
"unit_of_measurement": UnitOfTemperature.CELSIUS, "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 # unit of temperature sensor is automatically converted to the system UoM
assert entity.attributes["unit_of_measurement"] == state_unit assert entity.attributes["unit_of_measurement"] == state_unit
assert entity.attributes["foo"] == "bar" assert entity.attributes["foo"] == "bar"
assert entity.attributes["state_class"] == "total" assert entity.attributes["state_class"] == "measurement"
assert entity.domain == "sensor" assert entity.domain == "sensor"
assert entity.name == "Test 1 Battery Temperature" assert entity.name == "Test 1 Battery Temperature"
assert entity.state == state1 assert entity.state == state1

View File

@ -962,7 +962,7 @@ async def test_reregister_sensor(
"state": 100, "state": 100,
"type": "sensor", "type": "sensor",
"unique_id": "abcd", "unique_id": "abcd",
"state_class": "total", "state_class": "measurement",
"device_class": "battery", "device_class": "battery",
"entity_category": "diagnostic", "entity_category": "diagnostic",
"icon": "mdi:new-icon", "icon": "mdi:new-icon",