Update dependencies

This commit is contained in:
Jules 2024-10-27 11:40:15 +01:00
parent 09de4fbaa7
commit ec84b405de
Signed by: jdejaegh
GPG key ID: 99D6D184CA66933A
6 changed files with 15 additions and 18 deletions

View file

@ -62,23 +62,19 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry):
new = {**config_entry.data}
if config_entry.version == 1:
new = new | {CONF_STYLE: OPTION_STYLE_STD, CONF_DARK_MODE: True}
config_entry.version = 2
hass.config_entries.async_update_entry(config_entry, data=new)
hass.config_entries.async_update_entry(config_entry, data=new, version=2)
if config_entry.version == 2:
new = new | {CONF_USE_DEPRECATED_FORECAST: OPTION_DEPRECATED_FORECAST_NOT_USED}
config_entry.version = 3
hass.config_entries.async_update_entry(config_entry, data=new)
hass.config_entries.async_update_entry(config_entry, data=new, version=3)
if config_entry.version == 3:
new = new | {CONF_LANGUAGE_OVERRIDE: None}
config_entry.version = 4
hass.config_entries.async_update_entry(config_entry, data=new)
hass.config_entries.async_update_entry(config_entry, data=new, version=4)
if config_entry.version == 4:
new[CONF_LANGUAGE_OVERRIDE] = 'none' if new[CONF_LANGUAGE_OVERRIDE] is None else new[CONF_LANGUAGE_OVERRIDE]
config_entry.version = 5
hass.config_entries.async_update_entry(config_entry, data=new)
hass.config_entries.async_update_entry(config_entry, data=new, version=5)
_LOGGER.debug(f"Migration to version {config_entry.version} successful")

View file

@ -10,7 +10,7 @@
"issue_tracker": "https://github.com/jdejaegh/irm-kmi-ha/issues",
"requirements": [
"svgwrite==1.4.3",
"aiofile==3.8.8"
"aiofile==3.9.0"
],
"version": "0.2.19"
}

View file

@ -1,6 +1,6 @@
aiohttp==3.9.5
aiohttp==3.10.8
async-timeout==4.0.3
homeassistant==2024.6.4
voluptuous==0.13.1
homeassistant==2024.10.4
voluptuous==0.15.2
svgwrite==1.4.3
aiofile==3.8.8
aiofile==3.9.0

View file

@ -1,5 +1,5 @@
homeassistant==2024.6.4
pytest_homeassistant_custom_component==0.13.136
homeassistant==2024.10.4
pytest_homeassistant_custom_component==0.13.175
pytest
freezegun
isort

View file

@ -93,8 +93,8 @@ async def test_daily_forecast(
mock_config_entry: MockConfigEntry
) -> None:
api_data = get_api_data("forecast.json").get('for', {}).get('daily')
mock_config_entry.data = mock_config_entry.data | {CONF_LANGUAGE_OVERRIDE: 'fr'}
await hass.config_entries.async_add(mock_config_entry)
hass.config_entries.async_update_entry(mock_config_entry, data=mock_config_entry.data | {CONF_LANGUAGE_OVERRIDE: 'fr'})
coordinator = IrmKmiCoordinator(hass, mock_config_entry)
result = await coordinator.daily_list_to_forecast(api_data)

View file

@ -67,7 +67,8 @@ async def test_next_warning_when_data_available(
mock_config_entry: MockConfigEntry
) -> None:
api_data = get_api_data("be_forecast_warning.json")
mock_config_entry.data = mock_config_entry.data | {CONF_LANGUAGE_OVERRIDE: 'de'}
await hass.config_entries.async_add(mock_config_entry)
hass.config_entries.async_update_entry(mock_config_entry, data=mock_config_entry.data | {CONF_LANGUAGE_OVERRIDE: 'de'})
coordinator = IrmKmiCoordinator(hass, mock_config_entry)