From e6ec54d8c58b92e2ec8c9037c0569ae71acef362 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Wed, 15 Apr 2026 09:47:30 +0000 Subject: [PATCH] fix(repairs): force statistics-review issue visible on mode change async_create_issue preserves dismissed_version when called with the same issue_id. This means that if a user had previously dismissed the repair issue, changing the currency mode again would set the flag but the issue would stay hidden (because it still has a dismissed_version). Fix: use delete + create in the options flow when mode_changed=True. This resets dismissed_version so the new instance is always visible. The __init__.py path (HA restart with flag set) continues to use plain async_create_issue so that a restart alone does not un-dismiss an issue the user already acknowledged. Released-Bug: no --- .../tibber_prices/config_flow_handlers/options_flow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/tibber_prices/config_flow_handlers/options_flow.py b/custom_components/tibber_prices/config_flow_handlers/options_flow.py index 6dcc7b0..fb40ce1 100644 --- a/custom_components/tibber_prices/config_flow_handlers/options_flow.py +++ b/custom_components/tibber_prices/config_flow_handlers/options_flow.py @@ -517,11 +517,14 @@ class TibberPricesOptionsFlowHandler(OptionsFlow): mode_changed = old_mode is not None and new_mode is not None and old_mode != new_mode if mode_changed: - # Set persistent flag so repair issue reappears after dismiss + HA restart + # Set persistent flag so repair issue reappears after HA restart self.hass.config_entries.async_update_entry( self.config_entry, data={**self.config_entry.data, DATA_STATISTICS_REVIEW_REQUIRED: True}, ) + # delete + create resets dismissed_version, forcing the issue into view + # even if the user had dismissed a previous instance of this issue. + ir.async_delete_issue(self.hass, DOMAIN, issue_id) ir.async_create_issue( self.hass, DOMAIN,