mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Validate units when importing statistics (#78891)
This commit is contained in:
@@ -343,6 +343,7 @@ async def test_fossil_energy_consumption_no_co2(hass, hass_ws_client, recorder_m
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_1",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -377,6 +378,7 @@ async def test_fossil_energy_consumption_no_co2(hass, hass_ws_client, recorder_m
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_2",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -504,6 +506,7 @@ async def test_fossil_energy_consumption_hole(hass, hass_ws_client, recorder_moc
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_1",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -538,6 +541,7 @@ async def test_fossil_energy_consumption_hole(hass, hass_ws_client, recorder_moc
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_2",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -663,6 +667,7 @@ async def test_fossil_energy_consumption_no_data(hass, hass_ws_client, recorder_
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_1",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -697,6 +702,7 @@ async def test_fossil_energy_consumption_no_data(hass, hass_ws_client, recorder_
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_2",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -813,6 +819,7 @@ async def test_fossil_energy_consumption(hass, hass_ws_client, recorder_mock):
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_1",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -847,6 +854,7 @@ async def test_fossil_energy_consumption(hass, hass_ws_client, recorder_mock):
|
||||
"has_sum": True,
|
||||
"name": "Total imported energy",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "kWh",
|
||||
"statistic_id": "test:total_energy_import_tariff_2",
|
||||
"unit_of_measurement": "kWh",
|
||||
}
|
||||
@@ -877,6 +885,7 @@ async def test_fossil_energy_consumption(hass, hass_ws_client, recorder_mock):
|
||||
"has_sum": False,
|
||||
"name": "Fossil percentage",
|
||||
"source": "test",
|
||||
"state_unit_of_measurement": "%",
|
||||
"statistic_id": "test:fossil_percentage",
|
||||
"unit_of_measurement": "%",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user