mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Update Stookwijzer diagnostics and description (#141041)
Update diagnostics and description
This commit is contained in:
parent
3101d9099b
commit
1fafe81d20
@ -18,4 +18,5 @@ async def async_get_config_entry_diagnostics(
|
|||||||
"advice": client.advice,
|
"advice": client.advice,
|
||||||
"air_quality_index": client.lki,
|
"air_quality_index": client.lki,
|
||||||
"windspeed_ms": client.windspeed_ms,
|
"windspeed_ms": client.windspeed_ms,
|
||||||
|
"forecast": await client.async_get_forecast(),
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
},
|
},
|
||||||
"issues": {
|
"issues": {
|
||||||
"location_migration_failed": {
|
"location_migration_failed": {
|
||||||
"description": "The Stookwijzer integration was unable to automatically migrate your location to a new format the updated integrations uses.\n\nMake sure you are connected to the internet and restart Home Assistant to try again.\n\nIf this doesn't resolve the error, remove and re-add the integration.",
|
"description": "The Stookwijzer integration was unable to automatically migrate your location to a new format the updated integration uses.\n\nMake sure you are connected to the Internet and restart Home Assistant to try again.\n\nIf this doesn't resolve the error, remove and re-add the integration.",
|
||||||
"title": "Migration of your location failed"
|
"title": "Migration of your location failed"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Fixtures for Stookwijzer integration tests."""
|
"""Fixtures for Stookwijzer integration tests."""
|
||||||
|
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
|
from typing import Required, TypedDict
|
||||||
from unittest.mock import AsyncMock, MagicMock, patch
|
from unittest.mock import AsyncMock, MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -12,6 +13,14 @@ from homeassistant.core import HomeAssistant
|
|||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
|
class Forecast(TypedDict):
|
||||||
|
"""Typed Stookwijzer forecast dict."""
|
||||||
|
|
||||||
|
datetime: Required[str]
|
||||||
|
advice: str | None
|
||||||
|
final: bool | None
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_config_entry() -> MockConfigEntry:
|
def mock_config_entry() -> MockConfigEntry:
|
||||||
"""Return the default mocked config entry."""
|
"""Return the default mocked config entry."""
|
||||||
@ -80,6 +89,28 @@ def mock_stookwijzer() -> Generator[MagicMock]:
|
|||||||
client.windspeed_ms = 2.5
|
client.windspeed_ms = 2.5
|
||||||
client.windspeed_bft = 2
|
client.windspeed_bft = 2
|
||||||
client.advice = "code_yellow"
|
client.advice = "code_yellow"
|
||||||
|
client.async_get_forecast.return_value = (
|
||||||
|
Forecast(
|
||||||
|
datetime="2025-02-12T17:00:00+01:00",
|
||||||
|
advice="code_yellow",
|
||||||
|
final=True,
|
||||||
|
),
|
||||||
|
Forecast(
|
||||||
|
datetime="2025-02-12T23:00:00+01:00",
|
||||||
|
advice="code_yellow",
|
||||||
|
final=True,
|
||||||
|
),
|
||||||
|
Forecast(
|
||||||
|
datetime="2025-02-13T05:00:00+01:00",
|
||||||
|
advice="code_orange",
|
||||||
|
final=False,
|
||||||
|
),
|
||||||
|
Forecast(
|
||||||
|
datetime="2025-02-13T11:00:00+01:00",
|
||||||
|
advice="code_orange",
|
||||||
|
final=False,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
yield stookwijzer_mock
|
yield stookwijzer_mock
|
||||||
|
|
||||||
|
@ -3,6 +3,28 @@
|
|||||||
dict({
|
dict({
|
||||||
'advice': 'code_yellow',
|
'advice': 'code_yellow',
|
||||||
'air_quality_index': 2,
|
'air_quality_index': 2,
|
||||||
|
'forecast': list([
|
||||||
|
dict({
|
||||||
|
'advice': 'code_yellow',
|
||||||
|
'datetime': '2025-02-12T17:00:00+01:00',
|
||||||
|
'final': True,
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'advice': 'code_yellow',
|
||||||
|
'datetime': '2025-02-12T23:00:00+01:00',
|
||||||
|
'final': True,
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'advice': 'code_orange',
|
||||||
|
'datetime': '2025-02-13T05:00:00+01:00',
|
||||||
|
'final': False,
|
||||||
|
}),
|
||||||
|
dict({
|
||||||
|
'advice': 'code_orange',
|
||||||
|
'datetime': '2025-02-13T11:00:00+01:00',
|
||||||
|
'final': False,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
'windspeed_ms': 2.5,
|
'windspeed_ms': 2.5,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
Loading…
x
Reference in New Issue
Block a user