From e542f71593738496568898bb783951c605786c6d Mon Sep 17 00:00:00 2001 From: BottlecapDave Date: Fri, 29 Aug 2025 19:48:06 +0100 Subject: [PATCH 1/3] fix: fixed ability to set zero for min/max values (30 minutes dev time) --- custom_components/target_timeframes/const.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/target_timeframes/const.py b/custom_components/target_timeframes/const.py index 7f1d1f6..8fd21ce 100644 --- a/custom_components/target_timeframes/const.py +++ b/custom_components/target_timeframes/const.py @@ -119,8 +119,8 @@ vol.Optional(CONFIG_TARGET_ROLLING_TARGET, default=False): bool, vol.Optional(CONFIG_TARGET_LATEST_VALUES, default=False): bool, vol.Optional(CONFIG_TARGET_FIND_HIGHEST_VALUES, default=False): bool, - vol.Optional(CONFIG_TARGET_MIN_VALUE): float, - vol.Optional(CONFIG_TARGET_MAX_VALUE): float, + vol.Optional(CONFIG_TARGET_MIN_VALUE): vol.Coerce(float), + vol.Optional(CONFIG_TARGET_MAX_VALUE): vol.Coerce(float), vol.Optional(CONFIG_TARGET_WEIGHTING): str, vol.Required(CONFIG_TARGET_DANGEROUS_SETTINGS): section( vol.Schema( @@ -169,8 +169,8 @@ ), vol.Optional(CONFIG_TARGET_LATEST_VALUES): bool, vol.Optional(CONFIG_TARGET_FIND_HIGHEST_VALUES): bool, - vol.Optional(CONFIG_TARGET_MIN_VALUE): float, - vol.Optional(CONFIG_TARGET_MAX_VALUE): float, + vol.Optional(CONFIG_TARGET_MIN_VALUE): vol.Coerce(float), + vol.Optional(CONFIG_TARGET_MAX_VALUE): vol.Coerce(float), vol.Optional(CONFIG_TARGET_WEIGHTING): str, vol.Required(CONFIG_TARGET_DANGEROUS_SETTINGS): section( vol.Schema( From c4a2f844a5e959583a798a91d3393280b7f7ed6c Mon Sep 17 00:00:00 2001 From: BottlecapDave Date: Sun, 7 Sep 2025 16:44:13 +0100 Subject: [PATCH 2/3] fix: fixed target timeframes to support reloading entity upon updating configuration (15 minutes dev time) --- custom_components/target_timeframes/config_flow.py | 4 ++-- hacs.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/target_timeframes/config_flow.py b/custom_components/target_timeframes/config_flow.py index 5b82a0d..2a94a83 100644 --- a/custom_components/target_timeframes/config_flow.py +++ b/custom_components/target_timeframes/config_flow.py @@ -120,7 +120,7 @@ async def async_step_reconfigure(self, user_input: dict[str, Any] | None = None) errors = validate_target_timeframe_config(config) if len(errors) < 1 and user_input is not None: - return self.async_update_and_abort( + return self.async_update_reload_and_abort( self._get_entry(), self._get_reconfigure_subentry(), data_updates=config, @@ -165,7 +165,7 @@ async def async_step_reconfigure(self, user_input: dict[str, Any] | None = None) errors = validate_rolling_target_timeframe_config(config) if len(errors) < 1 and user_input is not None: - return self.async_update_and_abort( + return self.async_update_reload_and_abort( self._get_entry(), self._get_reconfigure_subentry(), data_updates=config, diff --git a/hacs.json b/hacs.json index adc9b00..bdf1bc0 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "Target Timeframes", "render_readme": true, - "homeassistant": "2025.4.0", + "homeassistant": "2025.9.0", "hide_default_branch": true } \ No newline at end of file From 950419eff2325398617573cd2174e266298980d2 Mon Sep 17 00:00:00 2001 From: BottlecapDave Date: Sun, 7 Sep 2025 16:47:41 +0100 Subject: [PATCH 3/3] docs: updated FAQ based on entities not updating config --- _docs/faq.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_docs/faq.md b/_docs/faq.md index 12c952d..6b050db 100644 --- a/_docs/faq.md +++ b/_docs/faq.md @@ -2,7 +2,9 @@ ## I've updated the configuration of one of my target timeframe sensors but it's not updating. Is there something wrong? -For some reason when you update the configuration via the integration page, the associated entities don't update. You'll need to reload the parent entry to get the configuration to take effect. This is something I'm currently investigating. +This was an issue before Home Assistant 2025.09. If you update to 2025.09 or later, this should no longer be an issue. + +If you are on a version before Home Assistant 2025.09, then you'll need to reload the parent entry to get the configuration to take effect. ## I've setup a target timeframe with the default time period (00:00-00:00) or a rolling target timeframe looking ahead for 24 hours but it's not updating. Is something broken?