Fix typos, fix await in windy_func
parent
0c42c8d827
commit
0679f1e559
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue