Fix recorder test (#55169)

Co-authored-by: Erik <erik@montnemery.com>
This commit is contained in:
Paulus Schoutsen 2021-08-24 23:48:13 -07:00 committed by GitHub
parent b4238443c8
commit 1e05c81fe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -220,7 +220,7 @@ async def test_cost_sensor_price_entity(
hass.states.async_set( hass.states.async_set(
usage_sensor_entity_id, usage_sensor_entity_id,
"14", "14",
{ATTR_UNIT_OF_MEASUREMENT: ENERGY_KILO_WATT_HOUR}, energy_attributes,
) )
await hass.async_block_till_done() await hass.async_block_till_done()
state = hass.states.get(cost_sensor_entity_id) state = hass.states.get(cost_sensor_entity_id)

View File

@ -359,6 +359,7 @@ def test_compile_hourly_sum_statistics_total_increasing_small_dip(
assert stats == { assert stats == {
"sensor.test1": [ "sensor.test1": [
{ {
"last_reset": None,
"statistic_id": "sensor.test1", "statistic_id": "sensor.test1",
"start": process_timestamp_to_utc_isoformat(zero), "start": process_timestamp_to_utc_isoformat(zero),
"max": None, "max": None,
@ -368,6 +369,7 @@ def test_compile_hourly_sum_statistics_total_increasing_small_dip(
"sum": approx(factor * 10.0), "sum": approx(factor * 10.0),
}, },
{ {
"last_reset": None,
"statistic_id": "sensor.test1", "statistic_id": "sensor.test1",
"start": process_timestamp_to_utc_isoformat(zero + timedelta(hours=1)), "start": process_timestamp_to_utc_isoformat(zero + timedelta(hours=1)),
"max": None, "max": None,
@ -377,6 +379,7 @@ def test_compile_hourly_sum_statistics_total_increasing_small_dip(
"sum": approx(factor * 30.0), "sum": approx(factor * 30.0),
}, },
{ {
"last_reset": None,
"statistic_id": "sensor.test1", "statistic_id": "sensor.test1",
"start": process_timestamp_to_utc_isoformat(zero + timedelta(hours=2)), "start": process_timestamp_to_utc_isoformat(zero + timedelta(hours=2)),
"max": None, "max": None,