Remove check for obsolete "rain_product_available" in meteo_france (#128533)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
alorente 2024-10-25 18:58:34 +02:00 committed by GitHub
parent 0b4e3c3db5
commit 4ef629f79d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,24 +75,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if not coordinator_forecast.last_update_success: if not coordinator_forecast.last_update_success:
raise ConfigEntryNotReady raise ConfigEntryNotReady
# Check if rain forecast is available. # Check rain forecast.
if coordinator_forecast.data.position.get("rain_product_available") == 1: coordinator_rain = DataUpdateCoordinator(
coordinator_rain = DataUpdateCoordinator( hass,
hass, _LOGGER,
_LOGGER, name=f"Météo-France rain for city {entry.title}",
name=f"Météo-France rain for city {entry.title}", update_method=_async_update_data_rain,
update_method=_async_update_data_rain, update_interval=SCAN_INTERVAL_RAIN,
update_interval=SCAN_INTERVAL_RAIN, )
) await coordinator_rain.async_config_entry_first_refresh()
await coordinator_rain.async_refresh()
if not coordinator_rain.last_update_success:
raise ConfigEntryNotReady
else:
_LOGGER.warning(
"1 hour rain forecast not available. %s is not in covered zone",
entry.title,
)
department = coordinator_forecast.data.position.get("dept") department = coordinator_forecast.data.position.get("dept")
_LOGGER.debug( _LOGGER.debug(