Compare commits

..

No commits in common. "7257587b2f4b494dd91798303e2b72087176a370" and "5395103c013eac95bbdfd83a349fbf443b7bf499" have entirely different histories.

5 changed files with 68 additions and 118 deletions

View File

@ -53,15 +53,15 @@ class ConfigOptionsFlowHandler(OptionsFlow):
self.user_data: dict[str, Any] = { self.user_data: dict[str, Any] = {
API_ID: self.config_entry.options.get(API_ID), API_ID: self.config_entry.options.get(API_ID),
API_KEY: self.config_entry.options.get(API_KEY), API_KEY: self.config_entry.options.get(API_KEY),
WSLINK: self.config_entry.options.get(WSLINK, False), WSLINK: self.config_entry.options.get(WSLINK),
DEV_DBG: self.config_entry.options.get(DEV_DBG, False), DEV_DBG: self.config_entry.options.get(DEV_DBG),
} }
self.user_data_schema = { self.user_data_schema = {
vol.Required(API_ID, default=self.user_data[API_ID] or ""): str, vol.Required(API_ID, default=self.user_data[API_ID] or ""): str,
vol.Required(API_KEY, default=self.user_data[API_KEY] or ""): str, vol.Required(API_KEY, default=self.user_data[API_KEY] or ""): str,
vol.Optional(WSLINK, default=self.user_data[WSLINK]): bool or False, vol.Optional(WSLINK, default=self.user_data[WSLINK]): bool,
vol.Optional(DEV_DBG, default=self.user_data[DEV_DBG]): bool or False, vol.Optional(DEV_DBG, default=self.user_data[DEV_DBG]): bool,
} }
self.sensors: dict[str, Any] = { self.sensors: dict[str, Any] = {
@ -72,22 +72,23 @@ class ConfigOptionsFlowHandler(OptionsFlow):
self.windy_data: dict[str, Any] = { self.windy_data: dict[str, Any] = {
WINDY_API_KEY: self.config_entry.options.get(WINDY_API_KEY), WINDY_API_KEY: self.config_entry.options.get(WINDY_API_KEY),
WINDY_ENABLED: self.config_entry.options.get(WINDY_ENABLED, False), WINDY_ENABLED: self.config_entry.options.get(WINDY_ENABLED)
WINDY_LOGGER_ENABLED: self.config_entry.options.get( if isinstance(self.config_entry.options.get(WINDY_ENABLED), bool)
WINDY_LOGGER_ENABLED, False else False,
), WINDY_LOGGER_ENABLED: self.config_entry.options.get(WINDY_LOGGER_ENABLED)
if isinstance(self.config_entry.options.get(WINDY_LOGGER_ENABLED), bool)
else False,
} }
self.windy_data_schema = { self.windy_data_schema = {
vol.Optional( vol.Optional(
WINDY_API_KEY, default=self.windy_data[WINDY_API_KEY] or "" WINDY_API_KEY, default=self.windy_data[WINDY_API_KEY] or ""
): str, ): str,
vol.Optional(WINDY_ENABLED, default=self.windy_data[WINDY_ENABLED]): bool vol.Optional(WINDY_ENABLED, default=self.windy_data[WINDY_ENABLED]): bool,
or False,
vol.Optional( vol.Optional(
WINDY_LOGGER_ENABLED, WINDY_LOGGER_ENABLED,
default=self.windy_data[WINDY_LOGGER_ENABLED], default=self.windy_data[WINDY_LOGGER_ENABLED],
): bool or False, ): bool,
} }
async def async_step_init(self, user_input=None): async def async_step_init(self, user_input=None):
@ -149,6 +150,10 @@ class ConfigOptionsFlowHandler(OptionsFlow):
return self.async_show_form( return self.async_show_form(
step_id="windy", step_id="windy",
data_schema=self.windy_data_schema, data_schema=self.windy_data_schema,
description_placeholders={
WINDY_ENABLED: True,
WINDY_LOGGER_ENABLED: user_input[WINDY_LOGGER_ENABLED],
},
errors=errors, errors=errors,
) )

View File

@ -10,6 +10,6 @@
"issue_tracker": "https://github.com/schizza/SWS-12500-custom-component/issues", "issue_tracker": "https://github.com/schizza/SWS-12500-custom-component/issues",
"requirements": [], "requirements": [],
"ssdp": [], "ssdp": [],
"version": "1.5.1", "version": "1.5.0",
"zeroconf": [] "zeroconf": []
} }

View File

@ -5,27 +5,21 @@
"valid_credentials_key": "Provide valid API KEY.", "valid_credentials_key": "Provide valid API KEY.",
"valid_credentials_match": "API ID and API KEY should not be the same." "valid_credentials_match": "API ID and API KEY should not be the same."
}, },
"step": { "step": {
"user": { "user": {
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure access for Weather Station",
"data": { "data": {
"API_ID": "API ID / Station ID", "API_ID": "API ID / Station ID",
"API_KEY": "API KEY / Password", "API_KEY": "API KEY / Password",
"WSLINK": "WSLink API",
"dev_debug_checkbox": "Developer log" "dev_debug_checkbox": "Developer log"
}, },
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure access for Weather Station",
"data_description": { "data_description": {
"dev_debug_checkbox": " Enable only if you want to send debuging data to the developer.", "dev_debug_checkbox": " Enable only if you want to send debuging data to the developer."
"API_ID": "API ID is the Station ID you set in the Weather Station.",
"API_KEY": "API KEY is the password you set in the Weather Station.",
"WSLINK": "Enable WSLink API if the station is set to send data via WSLink."
} }
} }
} }
}, },
"options": { "options": {
"error": { "error": {
"valid_credentials_api": "Provide valid API ID.", "valid_credentials_api": "Provide valid API ID.",
@ -33,47 +27,35 @@
"valid_credentials_match": "API ID and API KEY should not be the same.", "valid_credentials_match": "API ID and API KEY should not be the same.",
"windy_key_required": "Windy API key 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": { "step": {
"basic": {
"data": {
"API_ID": "API ID / Station ID",
"API_KEY": "API KEY / Password",
"dev_debug_checkbox": "Developer log"
},
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure credentials",
"data_description": {
"dev_debug_checkbox": " Enable only if you want to send debuging data to the developer."
}
},
"init": { "init": {
"title": "Configure SWS12500 Integration",
"description": "Choose what do you want to configure. If basic access or resending data for Windy site", "description": "Choose what do you want to configure. If basic access or resending data for Windy site",
"menu_options": { "menu_options": {
"basic": "Basic - configure credentials for Weather Station", "basic": "Basic - configure credentials for Weather Station",
"windy": "Windy configuration" "windy": "Windy configuration"
}
},
"basic": {
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure credentials",
"data": {
"API_ID": "API ID / Station ID",
"API_KEY": "API KEY / Password",
"WSLINK": "WSLink API",
"dev_debug_checkbox": "Developer log"
}, },
"data_description": { "title": "Configure SWS12500 Integration"
"dev_debug_checkbox": " Enable only if you want to send debuging data to the developer.",
"API_ID": "API ID is the Station ID you set in the Weather Station.",
"API_KEY": "API KEY is the password you set in the Weather Station.",
"WSLINK": "Enable WSLink API if the station is set to send data via WSLink."
}
}, },
"windy": { "windy": {
"description": "Resend weather data to your Windy stations.",
"title": "Configure Windy",
"data": { "data": {
"WINDY_API_KEY": "API KEY provided by Windy", "WINDY_API_KEY": "API KEY provided by Windy",
"windy_enabled_checkbox": "Enable resending data to Windy", "windy_enabled_checkbox": "Enable resending data to Windy",
"windy_logger_checkbox": "Log Windy data and responses" "windy_logger_checkbox": "Log Windy data and responses"
}, },
"data_description": { "description": "Resend weather data to your Windy stations.",
"WINDY_API_KEY": "Windy API KEY obtained from https://https://api.windy.com/keys", "title": "Configure Windy"
"windy_logger_checkbox": "Enable only if you want to send debuging data to the developer."
}
} }
} }
}, },
@ -95,12 +77,6 @@
"solar_radiation": { "name": "Solar irradiance" }, "solar_radiation": { "name": "Solar irradiance" },
"ch2_temp": { "name": "Channel 2 temperature" }, "ch2_temp": { "name": "Channel 2 temperature" },
"ch2_humidity": { "name": "Channel 2 humidity" }, "ch2_humidity": { "name": "Channel 2 humidity" },
"ch3_temp": { "name": "Channel 3 temperature" },
"ch3_humidity": { "name": "Channel 3 humidity" },
"ch4_temp": { "name": "Channel 4 temperature" },
"ch4_humidity": { "name": "Channel 4 humidity" },
"heat_index": { "name": "Apparent temperature" },
"chill_index": { "name": "Wind chill" },
"wind_azimut": { "wind_azimut": {
"name": "Bearing", "name": "Bearing",
"state": { "state": {

View File

@ -7,24 +7,20 @@
}, },
"step": { "step": {
"user": { "user": {
"description": "Zadejte API ID a API KEY, aby meteostanice mohla komunikovat s HomeAssistantem",
"title": "Nastavení přihlášení",
"data": { "data": {
"API_ID": "API ID / ID Stanice", "API_ID": "API ID / ID stanice",
"API_KEY": "API KEY / Heslo", "API_KEY": "API KEY / Heslo",
"wslink": "WSLink API", "wslink": "WSLink API",
"dev_debug_checkbox": "Developer log" "dev_debug_checkbox": "Developer log"
}, },
"description": "Zadejte API ID a API KEY, aby meteostanice mohla komunikovat s HomeAssistantem",
"title": "Nastavení přístpu pro metostanici",
"data_description": { "data_description": {
"dev_debug_checkbox": "Zapnout pouze v případě, že chcete poslat ladící informace vývojáři.", "dev_debug_checkbox": " Zapnout pouze v případě, že chcete poslat ladící informace vývojáři."
"API_ID": "API ID je ID stanice, které jste nastavili v meteostanici.",
"API_KEY": "API KEY je heslo, které jste nastavili v meteostanici.",
"wslink": "WSLink API zapněte, pokud je stanice nastavena na zasílání dat přes WSLink."
} }
} }
} }
}, },
"options": { "options": {
"error": { "error": {
"valid_credentials_api": "Vyplňte platné API ID", "valid_credentials_api": "Vyplňte platné API ID",
@ -32,50 +28,39 @@
"valid_credentials_match": "API ID a API KEY nesmějí být stejné!", "valid_credentials_match": "API ID a API KEY nesmějí být stejné!",
"windy_key_required": "Je vyžadován Windy API 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"
}, },
"step": { "step": {
"init": {
"title": "Nastavení integrace SWS12500",
"description": "Vyberte, co chcete konfigurovat. Zda přihlašovací údaje nebo nastavení pro přeposílání dat na Windy.",
"menu_options": {
"basic": "Základní - přístupové údaje (přihlášení)",
"windy": "Nastavení pro přeposílání dat na Windy"
}
},
"basic": { "basic": {
"description": "Zadejte API ID a API KEY, aby meteostanice mohla komunikovat s HomeAssistantem",
"title": "Nastavení přihlášení",
"data": { "data": {
"API_ID": "API ID / ID Stanice", "API_ID": "API ID / ID Stanice",
"API_KEY": "API KEY / Heslo", "API_KEY": "API KEY / Heslo",
"wslink": "WSLink API", "wslink": "WSLink API",
"dev_debug_checkbox": "Developer log" "dev_debug_checkbox": "Developer log"
}, },
"description": "Zadejte API ID a API KEY, aby meteostanice mohla komunikovat s HomeAssistantem",
"title": "Nastavení přihlášení",
"data_description": { "data_description": {
"dev_debug_checkbox": "Zapnout pouze v případě, že chcete poslat ladící informace vývojáři.", "dev_debug_checkbox": " Zapnout pouze v případě, že chcete poslat ladící informace vývojáři."
"API_ID": "API ID je ID stanice, které jste nastavili v meteostanici.",
"API_KEY": "API KEY je heslo, které jste nastavili v meteostanici.",
"wslink": "WSLink API zapněte, pokud je stanice nastavena na zasílání dat přes WSLink."
} }
}, },
"init": {
"description": "Vyberte, co chcete konfigurovat. Zda přihlašovací údaje nebo nastavení pro přeposílání dat na Windy.",
"menu_options": {
"basic": "Základní - přístupové údaje (přihlášení)",
"windy": "Nastavení pro přeposílání dat na Windy"
},
"title": "Nastavení integrace SWS12500"
},
"windy": { "windy": {
"description": "Přeposílání dat z metostanice na Windy",
"title": "Konfigurace Windy",
"data": { "data": {
"WINDY_API_KEY": "Klíč API KEY získaný z Windy", "WINDY_API_KEY": "Klíč API KEY získaný z Windy",
"windy_enabled_checkbox": "Povolit přeposílání dat na Windy", "windy_enabled_checkbox": "Povolit přeposílání dat na Windy",
"windy_logger_checkbox": "Logovat data a odpovědi z Windy" "windy_logger_checkbox": "Logovat data a odpovědi z Windy"
}, },
"data_description": { "description": "Přeposílání dat z metostanice na Windy",
"WINDY_API_KEY": "Klíč API KEY získaný z https://https://api.windy.com/keys", "title": "Konfigurace Windy"
"windy_logger_checkbox": "Zapnout pouze v případě, že chcete poslat ladící informace vývojáři."
}
} }
} }
}, },
"entity": { "entity": {
"sensor": { "sensor": {
"indoor_temp": { "name": "Vnitřní teplota" }, "indoor_temp": { "name": "Vnitřní teplota" },

View File

@ -5,27 +5,22 @@
"valid_credentials_key": "Provide valid API KEY.", "valid_credentials_key": "Provide valid API KEY.",
"valid_credentials_match": "API ID and API KEY should not be the same." "valid_credentials_match": "API ID and API KEY should not be the same."
}, },
"step": { "step": {
"user": { "user": {
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure access for Weather Station",
"data": { "data": {
"API_ID": "API ID / Station ID", "API_ID": "API ID / Station ID",
"API_KEY": "API KEY / Password", "API_KEY": "API KEY / Password",
"WSLINK": "WSLink API", "WSLINK": "WSLink API",
"dev_debug_checkbox": "Developer log" "dev_debug_checkbox": "Developer log"
}, },
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure access for Weather Station",
"data_description": { "data_description": {
"dev_debug_checkbox": " Enable only if you want to send debuging data to the developer.", "dev_debug_checkbox": " Enable only if you want to send debuging data to the developer."
"API_ID": "API ID is the Station ID you set in the Weather Station.",
"API_KEY": "API KEY is the password you set in the Weather Station.",
"WSLINK": "Enable WSLink API if the station is set to send data via WSLink."
} }
} }
} }
}, },
"options": { "options": {
"error": { "error": {
"valid_credentials_api": "Provide valid API ID.", "valid_credentials_api": "Provide valid API ID.",
@ -33,47 +28,36 @@
"valid_credentials_match": "API ID and API KEY should not be the same.", "valid_credentials_match": "API ID and API KEY should not be the same.",
"windy_key_required": "Windy API key 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": { "step": {
"init": {
"title": "Configure SWS12500 Integration",
"description": "Choose what do you want to configure. If basic access or resending data for Windy site",
"menu_options": {
"basic": "Basic - configure credentials for Weather Station",
"windy": "Windy configuration"
}
},
"basic": { "basic": {
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure credentials",
"data": { "data": {
"API_ID": "API ID / Station ID", "API_ID": "API ID / Station ID",
"API_KEY": "API KEY / Password", "API_KEY": "API KEY / Password",
"WSLINK": "WSLink API", "WSLINK": "WSLink API",
"dev_debug_checkbox": "Developer log" "dev_debug_checkbox": "Developer log"
}, },
"description": "Provide API ID and API KEY so the Weather Station can access HomeAssistant",
"title": "Configure credentials",
"data_description": { "data_description": {
"dev_debug_checkbox": " Enable only if you want to send debuging data to the developer.", "dev_debug_checkbox": " Enable only if you want to send debuging data to the developer."
"API_ID": "API ID is the Station ID you set in the Weather Station.",
"API_KEY": "API KEY is the password you set in the Weather Station.",
"WSLINK": "Enable WSLink API if the station is set to send data via WSLink."
} }
}, },
"init": {
"description": "Choose what do you want to configure. If basic access or resending data for Windy site",
"menu_options": {
"basic": "Basic - configure credentials for Weather Station",
"windy": "Windy configuration"
},
"title": "Configure SWS12500 Integration"
},
"windy": { "windy": {
"description": "Resend weather data to your Windy stations.",
"title": "Configure Windy",
"data": { "data": {
"WINDY_API_KEY": "API KEY provided by Windy", "WINDY_API_KEY": "API KEY provided by Windy",
"windy_enabled_checkbox": "Enable resending data to Windy", "windy_enabled_checkbox": "Enable resending data to Windy",
"windy_logger_checkbox": "Log Windy data and responses" "windy_logger_checkbox": "Log Windy data and responses"
}, },
"data_description": { "description": "Resend weather data to your Windy stations.",
"WINDY_API_KEY": "Windy API KEY obtained from https://https://api.windy.com/keys", "title": "Configure Windy"
"windy_logger_checkbox": "Enable only if you want to send debuging data to the developer."
}
} }
} }
}, },