Add display unit to WS recorder/get_statistics_metadata (#82870)

This commit is contained in:
Erik Montnemery 2022-11-28 19:46:57 +01:00 committed by GitHub
parent 3a65537c5e
commit a038314d8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 207 additions and 2 deletions

View file

@ -63,6 +63,7 @@ async def test_demo_statistics(recorder_mock, mock_history, hass):
list_statistic_ids, hass
)
assert {
"display_unit_of_measurement": "°C",
"has_mean": True,
"has_sum": False,
"name": "Outdoor temperature",
@ -72,6 +73,7 @@ async def test_demo_statistics(recorder_mock, mock_history, hass):
"unit_class": "temperature",
} in statistic_ids
assert {
"display_unit_of_measurement": "kWh",
"has_mean": False,
"has_sum": True,
"name": "Energy consumption 1",