From 9053bf01f710854efcc2be775ff7164f72678109 Mon Sep 17 00:00:00 2001 From: bruxy70 Date: Mon, 19 Dec 2022 10:59:40 +0100 Subject: [PATCH] Fix default date for first day (every_n_days) for iOS (No First date field in "every-n-days" #420) --- custom_components/garbage_collection/config_flow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/garbage_collection/config_flow.py b/custom_components/garbage_collection/config_flow.py index 8521467..01806c1 100644 --- a/custom_components/garbage_collection/config_flow.py +++ b/custom_components/garbage_collection/config_flow.py @@ -25,7 +25,7 @@ async def _validate_config( - handler: SchemaConfigFlowHandler | SchemaOptionsFlowHandler, data: Any + _: SchemaConfigFlowHandler | SchemaOptionsFlowHandler, data: Any ) -> Any: """Validate config.""" if const.CONF_DATE in data: @@ -209,7 +209,7 @@ async def detail_config_schema( if handler.options[const.CONF_FREQUENCY] in const.DAILY_FREQUENCY: # every-n-days options_schema[ - required(const.CONF_FIRST_DATE, handler.options) + required(const.CONF_FIRST_DATE, handler.options, helpers.now().date()) ] = selector.DateSelector() if handler.options.get(const.CONF_VERBOSE_STATE, False): # "verbose_state" @@ -224,7 +224,7 @@ async def detail_config_schema( return vol.Schema(options_schema) -async def choose_details_step(options: dict[str, Any]) -> str: +async def choose_details_step(_: dict[str, Any]) -> str: """Return next step_id for options flow.""" return "detail"