diff --git a/custom_components/sws12500/strings.json b/custom_components/sws12500/strings.json index 7e87bea..3ab8649 100644 --- a/custom_components/sws12500/strings.json +++ b/custom_components/sws12500/strings.json @@ -73,16 +73,16 @@ "description": "Resend data to Pocasi Meteo CZ", "title": "Configure Pocasi Meteo CZ", "data": { - "POCASI_API_ID": "ID from your Pocasi Meteo APP", - "POCASI_API_KEY": "Key from your Pocasi Meteo APP", - "POCASI_SEND_INTERVAL": "Resend interval in seconds", + "POCASI_CZ_API_ID": "ID from your Pocasi Meteo APP", + "POCASI_CZ_API_KEY": "Key from your Pocasi Meteo APP", + "POCASI_CZ_SEND_INTERVAL": "Resend interval in seconds", "pocasi_enabled_checkbox": "Enable resending data to Pocasi Meteo", "pocasi_logger_checkbox": "Log data and responses" }, "data_description": { - "POCASI_API_ID": "You can obtain your ID in Pocasi Meteo App", - "POCASI_API_KEY": "You can obtain your KEY in Pocasi Meteo App", - "POCASI_SEND_INTERVAL": "Resend interval in seconds (minimum 12s, default 30s)", + "POCASI_CZ_API_ID": "You can obtain your ID in Pocasi Meteo App", + "POCASI_CZ_API_KEY": "You can obtain your KEY in Pocasi Meteo App", + "POCASI_CZ_SEND_INTERVAL": "Resend interval in seconds (minimum 12s, default 30s)", "pocasi_enabled_checkbox": "Enables resending data to Pocasi Meteo", "pocasi_logger_checkbox": "Enable only if you want to send debbug data to the developer" } diff --git a/custom_components/sws12500/translations/en.json b/custom_components/sws12500/translations/en.json index 09b60cd..885634a 100644 --- a/custom_components/sws12500/translations/en.json +++ b/custom_components/sws12500/translations/en.json @@ -73,16 +73,16 @@ "description": "Resend data to Pocasi Meteo CZ", "title": "Configure Pocasi Meteo CZ", "data": { - "POCASI_API_ID": "ID from your Pocasi Meteo APP", - "POCASI_API_KEY": "Key from your Pocasi Meteo APP", - "POCASI_SEND_INTERVAL": "Resend interval in seconds", + "POCASI_CZ_API_ID": "ID from your Pocasi Meteo APP", + "POCASI_CZ_API_KEY": "Key from your Pocasi Meteo APP", + "POCASI_CZ_SEND_INTERVAL": "Resend interval in seconds", "pocasi_enabled_checkbox": "Enable resending data to Pocasi Meteo", "pocasi_logger_checkbox": "Log data and responses" }, "data_description": { - "POCASI_API_ID": "You can obtain your ID in Pocasi Meteo App", - "POCASI_API_KEY": "You can obtain your KEY in Pocasi Meteo App", - "POCASI_SEND_INTERVAL": "Resend interval in seconds (minimum 12s, default 30s)", + "POCASI_CZ_API_ID": "You can obtain your ID in Pocasi Meteo App", + "POCASI_CZ_API_KEY": "You can obtain your KEY in Pocasi Meteo App", + "POCASI_CZ_SEND_INTERVAL": "Resend interval in seconds (minimum 12s, default 30s)", "pocasi_enabled_checkbox": "Enables resending data to Pocasi Meteo", "pocasi_logger_checkbox": "Enable only if you want to send debbug data to the developer" } diff --git a/custom_components/sws12500/windy_func.py b/custom_components/sws12500/windy_func.py index 15cf2aa..286d6b6 100644 --- a/custom_components/sws12500/windy_func.py +++ b/custom_components/sws12500/windy_func.py @@ -3,6 +3,7 @@ from datetime import datetime, timedelta import logging +from aiohttp.client_exceptions import ClientError from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -138,20 +139,20 @@ class WindyPush: _LOGGER.critical(WINDY_INVALID_KEY) text_for_test = WINDY_INVALID_KEY - update_options(self.hass, self.config, WINDY_ENABLED, False) + await update_options(self.hass, self.config, WINDY_ENABLED, False) except WindySuccess: if self.log: _LOGGER.info(WINDY_SUCCESS) text_for_test = WINDY_SUCCESS - except session.ClientError as ex: + except ClientError as ex: _LOGGER.critical("Invalid response from Windy: %s", str(ex)) self.invalid_response_count += 1 if self.invalid_response_count > 3: _LOGGER.critical(WINDY_UNEXPECTED) text_for_test = WINDY_UNEXPECTED - update_options(self.hass, self.config, WINDY_ENABLED, False) + await update_options(self.hass, self.config, WINDY_ENABLED, False) self.last_update = datetime.now() self.next_update = self.last_update + timed(minutes=5)