From e691a07f722002ee2b97a798fea58a5f6508414d Mon Sep 17 00:00:00 2001 From: balgerion <133121849+balgerion@users.noreply.github.com> Date: Sun, 4 May 2025 15:05:59 +0200 Subject: [PATCH] Update config_flow.py --- custom_components/pstryk/config_flow.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/custom_components/pstryk/config_flow.py b/custom_components/pstryk/config_flow.py index a4ff67a..94bf13d 100644 --- a/custom_components/pstryk/config_flow.py +++ b/custom_components/pstryk/config_flow.py @@ -33,7 +33,9 @@ class PstrykConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): data_schema=vol.Schema({ vol.Required("api_key"): str, vol.Required("buy_top", default=5): vol.All(vol.Coerce(int), vol.Range(min=1, max=24)), - vol.Required("sell_top", default=5): vol.All(vol.Coerce(int), vol.Range(min=1, max=24)) + vol.Required("sell_top", default=5): vol.All(vol.Coerce(int), vol.Range(min=1, max=24)), + vol.Required("buy_worst", default=5): vol.All(vol.Coerce(int), vol.Range(min=1, max=24)), + vol.Required("sell_worst", default=5): vol.All(vol.Coerce(int), vol.Range(min=1, max=24)) }), errors=errors ) @@ -84,6 +86,12 @@ class PstrykOptionsFlowHandler(config_entries.OptionsFlow): vol.Required("sell_top", default=self.config_entry.options.get( "sell_top", self.config_entry.data.get("sell_top", 5))): vol.All( vol.Coerce(int), vol.Range(min=1, max=24)), + vol.Required("buy_worst", default=self.config_entry.options.get( + "buy_worst", self.config_entry.data.get("buy_worst", 5))): vol.All( + vol.Coerce(int), vol.Range(min=1, max=24)), + vol.Required("sell_worst", default=self.config_entry.options.get( + "sell_worst", self.config_entry.data.get("sell_worst", 5))): vol.All( + vol.Coerce(int), vol.Range(min=1, max=24)), } return self.async_show_form(