Use right state class in `filter` test (#107643)

pull/107666/head
Jan-Philipp Benecke 2024-01-09 16:06:36 +01:00 committed by GitHub
parent c62e79f9ee
commit 1a6418d361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -276,14 +276,14 @@ async def test_setup(
"icon": "mdi:test", "icon": "mdi:test",
ATTR_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, ATTR_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE,
ATTR_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, ATTR_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS,
ATTR_STATE_CLASS: SensorStateClass.TOTAL_INCREASING, ATTR_STATE_CLASS: SensorStateClass.MEASUREMENT,
}, },
) )
await hass.async_block_till_done() await hass.async_block_till_done()
state = hass.states.get("sensor.test") state = hass.states.get("sensor.test")
assert state.attributes["icon"] == "mdi:test" assert state.attributes["icon"] == "mdi:test"
assert state.attributes[ATTR_DEVICE_CLASS] == SensorDeviceClass.TEMPERATURE assert state.attributes[ATTR_DEVICE_CLASS] == SensorDeviceClass.TEMPERATURE
assert state.attributes[ATTR_STATE_CLASS] is SensorStateClass.TOTAL_INCREASING assert state.attributes[ATTR_STATE_CLASS] is SensorStateClass.MEASUREMENT
assert state.state == "1.0" assert state.state == "1.0"
entity_id = entity_registry.async_get_entity_id( entity_id = entity_registry.async_get_entity_id(