Compare commits

..

1 Commits

Author SHA1 Message Date
FigurinePanda43 e25a95277c
Merge 58b9da9b80 into 55652415f4 2026-02-03 17:51:26 +01:00
5 changed files with 12 additions and 35 deletions

View File

@ -86,7 +86,7 @@ class WeatherDataUpdateCoordinator(DataUpdateCoordinator):
raise HTTPUnauthorized
if self.config_entry.options.get(WINDY_ENABLED):
_ = await self.windy.push_data_to_windy(data, _wslink)
response = await self.windy.push_data_to_windy(data, _wslink)
if self.config.options.get(POCASI_CZ_ENABLED):
await self.pocasi.push_data_to_server(data, "WSLINK" if _wslink else "WU")

View File

@ -197,19 +197,13 @@ class ConfigOptionsFlowHandler(OptionsFlow):
errors=errors,
)
station_id = (user_input.get(WINDY_STATION_ID) or "").strip()
station_pw = (user_input.get(WINDY_STATION_PW) or "").strip()
if user_input.get(WINDY_ENABLED):
if not station_id:
errors[WINDY_STATION_ID] = "windy_id_required"
if not station_pw:
errors[WINDY_STATION_PW] = "windy_pw_required"
if errors:
return self.async_show_form(
step_id="windy",
data_schema=vol.Schema(self.windy_data_schema),
errors=errors,
)
if (user_input[WINDY_ENABLED] is True) and ((user_input[WINDY_STATION_ID] == "") or (user_input[WINDY_STATION_PW] == "")):
errors[WINDY_STATION_ID] = "windy_key_required"
return self.async_show_form(
step_id="windy",
data_schema=vol.Schema(self.windy_data_schema),
errors=errors,
)
# retain user_data
user_input.update(self.user_data)

View File

@ -29,8 +29,7 @@
"valid_credentials_api": "Vyplňte platné API ID",
"valid_credentials_key": "Vyplňte platný API KEY",
"valid_credentials_match": "API ID a API KEY nesmějí být stejné!",
"windy_id_required": "Je vyžadováno Windy ID, pokud chcete aktivovat přeposílání dat na Windy",
"windy_pw_required": "Je vyžadován Windy KEY, pokud chcete aktivovat přeposílání dat na Windy",
"windy_key_required": "Je vyžadován Windy API key, pokud chcete aktivovat přeposílání dat na Windy",
"pocasi_id_required": "Je vyžadován Počasí ID, pokud chcete aktivovat přeposílání dat na Počasí Meteo CZ",
"pocasi_key_required": "Klíč k účtu Počasí Meteo je povinný.",
"pocasi_send_minimum": "Minimální interval pro přeposílání je 12 sekund."

View File

@ -29,8 +29,7 @@
"valid_credentials_api": "Provide valid API ID.",
"valid_credentials_key": "Provide valid API KEY.",
"valid_credentials_match": "API ID and API KEY should not be the same.",
"windy_id_required": "Windy API key is required if you want to enable this function.",
"windy_pw_required": "Windy API password is required if you want to enable this function."
"windy_key_required": "Windy API key is required if you want to enable this function."
},
"step": {
"init": {

View File

@ -5,7 +5,6 @@ import logging
from aiohttp.client_exceptions import ClientError
from homeassistant.components import persistent_notification
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@ -139,22 +138,8 @@ class WindyPush:
if "t1solrad" in purged_data:
purged_data["solarradiation"] = purged_data.pop("t1solrad")
windy_station_id = self.config.options.get(WINDY_STATION_ID, "")
windy_station_pw = self.config.options.get(WINDY_STATION_PW, "")
if windy_station_id == "" or windy_station_pw == "":
_LOGGER.error(
"Windy ID or PASSWORD is not set correctly. Please reconfigure your WINDY resend credentials. Disabling WINDY resend for now!"
)
persistent_notification.async_create(
self.hass,
"Your Windy credentials are not set correctly. Disabling Windy resending for now. Update Windy options and enable reseding.",
"Windy resending disabled.",
)
await update_options(self.hass, self.config, WINDY_ENABLED, False)
return False
windy_station_id = self.config.options.get(WINDY_STATION_ID)
windy_station_pw = self.config.options.get(WINDY_STATION_PW)
request_url = f"{WINDY_URL}"