From 8a3cd4a173578d2fedc99d6648f190a8475831d4 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Thu, 15 Oct 2026 10:58:11 -0700 Subject: [PATCH 1/3] Repairs go with its config entry ID --- custom_components/solaredge_modbus_multi/__init__.py | 5 ++++- custom_components/solaredge_modbus_multi/hub.py | 6 ++++-- custom_components/solaredge_modbus_multi/repairs.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/custom_components/solaredge_modbus_multi/__init__.py b/custom_components/solaredge_modbus_multi/__init__.py index 2c927e07..d8f95717 100644 --- a/custom_components/solaredge_modbus_multi/__init__.py +++ b/custom_components/solaredge_modbus_multi/__init__.py @@ -242,6 +242,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: entry.options.get(CONF_SCAN_INTERVAL, ConfDefaultInt.SCAN_INTERVAL), ) + # Drop the entry-independent issue ID used by earlier versions. + ir.async_delete_issue(hass, DOMAIN, "check_configuration") + hass.data[DOMAIN][entry.entry_id] = { "hub": solaredge_hub, "coordinator": coordinator, @@ -390,7 +393,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> ir.async_create_issue( hass, DOMAIN, - "deprecated_keep_modbus_open", + f"deprecated_keep_modbus_open_{config_entry.entry_id}", is_fixable=False, severity=ir.IssueSeverity.WARNING, translation_key="deprecated_keep_modbus_open", diff --git a/custom_components/solaredge_modbus_multi/hub.py b/custom_components/solaredge_modbus_multi/hub.py index 28c03ce8..0d1c98d2 100644 --- a/custom_components/solaredge_modbus_multi/hub.py +++ b/custom_components/solaredge_modbus_multi/hub.py @@ -521,7 +521,7 @@ async def async_refresh_modbus_data(self) -> bool: ir.async_create_issue( self._hass, DOMAIN, - "check_configuration", + f"check_configuration_{self._entry_id}", is_fixable=True, severity=ir.IssueSeverity.ERROR, translation_key="check_configuration", @@ -531,7 +531,9 @@ async def async_refresh_modbus_data(self) -> bool: f"Coordinator setup timed out after {self.coordinator_timeout} seconds." ) from err - ir.async_delete_issue(self._hass, DOMAIN, "check_configuration") + ir.async_delete_issue( + self._hass, DOMAIN, f"check_configuration_{self._entry_id}" + ) return True diff --git a/custom_components/solaredge_modbus_multi/repairs.py b/custom_components/solaredge_modbus_multi/repairs.py index 98017635..1e008d10 100644 --- a/custom_components/solaredge_modbus_multi/repairs.py +++ b/custom_components/solaredge_modbus_multi/repairs.py @@ -164,7 +164,7 @@ async def async_create_fix_flow( entry_id = cast(str, data["entry_id"]) if (entry := hass.config_entries.async_get_entry(entry_id)) is not None: - if issue_id == "check_configuration": + if issue_id.startswith("check_configuration_"): return CheckConfigurationRepairFlow(entry) if issue_id.startswith("detect_timeout_gpc_"): From b74afe8a989c30ec86599d9cb45e1233b2e39cf1 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Thu, 15 Oct 2026 11:13:32 -0700 Subject: [PATCH 2/3] Update test_repairs.py --- tests/test_repairs.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_repairs.py b/tests/test_repairs.py index ce3b94cf..9f39460a 100644 --- a/tests/test_repairs.py +++ b/tests/test_repairs.py @@ -3,10 +3,13 @@ from types import SimpleNamespace from homeassistant.data_entry_flow import FlowResultType +from pytest_homeassistant_custom_component.common import MockConfigEntry from custom_components.solaredge_modbus_multi.const import DOMAIN from custom_components.solaredge_modbus_multi.repairs import ( + CheckConfigurationRepairFlow, RetryFeatureDetectionRepairFlow, + async_create_fix_flow, ) @@ -70,3 +73,15 @@ async def test_unknown_inverter_unit_id_is_a_no_op(hass): assert inverter.global_power_control is False assert result["type"] == FlowResultType.CREATE_ENTRY + + +async def test_check_configuration_issue_routes_to_its_flow(hass): + """Test the per-entry check_configuration issue ID opens its repair flow.""" + entry = MockConfigEntry(domain=DOMAIN) + entry.add_to_hass(hass) + + flow = await async_create_fix_flow( + hass, f"check_configuration_{entry.entry_id}", {"entry_id": entry.entry_id} + ) + + assert isinstance(flow, CheckConfigurationRepairFlow) From 96b13abb24392c23dde137d38d2bd1f0a4e1c966 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Fri, 16 Oct 2026 06:55:14 -0700 Subject: [PATCH 3/3] Delete shared deprecated_keep_modbus_open issue --- custom_components/solaredge_modbus_multi/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/solaredge_modbus_multi/__init__.py b/custom_components/solaredge_modbus_multi/__init__.py index d8f95717..5b806d81 100644 --- a/custom_components/solaredge_modbus_multi/__init__.py +++ b/custom_components/solaredge_modbus_multi/__init__.py @@ -244,6 +244,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: # Drop the entry-independent issue ID used by earlier versions. ir.async_delete_issue(hass, DOMAIN, "check_configuration") + ir.async_delete_issue(hass, DOMAIN, "deprecated_keep_modbus_open") hass.data[DOMAIN][entry.entry_id] = { "hub": solaredge_hub,