Extract Forecast.Solar DataUpdateCoordinator into module (#83859)

This commit is contained in:
Franck Nijhof 2022-12-20 17:24:27 +01:00 committed by GitHub
parent 78cc547782
commit 4ef7bb9bbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 81 additions and 60 deletions

View file

@ -60,7 +60,8 @@ def mock_forecast_solar(hass) -> Generator[None, MagicMock, None]:
hass fixture included because it sets the time zone.
"""
with patch(
"homeassistant.components.forecast_solar.ForecastSolar", autospec=True
"homeassistant.components.forecast_solar.coordinator.ForecastSolar",
autospec=True,
) as forecast_solar_mock:
forecast_solar = forecast_solar_mock.return_value
now = datetime(2021, 6, 27, 6, 0, tzinfo=dt_util.DEFAULT_TIME_ZONE)

View file

@ -29,7 +29,7 @@ async def test_load_unload_config_entry(
@patch(
"homeassistant.components.forecast_solar.ForecastSolar.estimate",
"homeassistant.components.forecast_solar.coordinator.ForecastSolar.estimate",
side_effect=ForecastSolarConnectionError,
)
async def test_config_entry_not_ready(