From 691f475c1fd687a8bf5af75935825b96f62d90e7 Mon Sep 17 00:00:00 2001 From: Tobias Feld Date: Fri, 30 Jan 2026 14:47:31 +0100 Subject: [PATCH 1/3] Update notification to only appear on first installation --- custom_components/evsemasterudp/__init__.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/custom_components/evsemasterudp/__init__.py b/custom_components/evsemasterudp/__init__.py index 5c945ab..5a7ad3a 100644 --- a/custom_components/evsemasterudp/__init__.py +++ b/custom_components/evsemasterudp/__init__.py @@ -58,6 +58,9 @@ async def _async_update_data(self): async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up the EVSE integration from a config entry""" + # Check if this is the first time setup + is_first_setup = entry.entry_id not in hass.data.get(DOMAIN, {}) + # Retrieve configuration parameters serial = entry.data.get("serial") password = entry.data.get("password") @@ -115,13 +118,14 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) # Notification recommending a restart after installation/update - create( - hass, - f"EVSE Master UDP successfully configured for EVSE {serial}.\n\n" - "It is recommended to restart Home Assistant for optimal operation.", - title="EVSE Master UDP - Installation successful", - notification_id=f"evsemasterudp_setup_{serial}" - ) + if is_first_setup: + create( + hass, + f"EVSE Master UDP successfully configured for EVSE {serial}.\n\n" + "It is recommended to restart Home Assistant for optimal operation.", + title="EVSE Master UDP - Installation successful", + notification_id=f"evsemasterudp_setup_{serial}" + ) return True From 9f6b9d71a20d223663a64e36215a961c09898a2c Mon Sep 17 00:00:00 2001 From: Tobias Feld Date: Fri, 30 Jan 2026 15:40:03 +0100 Subject: [PATCH 2/3] Fix incorrect indentation causing app to crash --- custom_components/evsemasterudp/evse_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/evsemasterudp/evse_client.py b/custom_components/evsemasterudp/evse_client.py index 12d13b3..55d1c84 100644 --- a/custom_components/evsemasterudp/evse_client.py +++ b/custom_components/evsemasterudp/evse_client.py @@ -284,7 +284,7 @@ def _can_start_charge(self, serial: str) -> bool: def _record_charge_state_change(self, serial: str) -> None: """Record a charge stop (to protect the next start)""" self._last_charge_change[serial] = datetime.now() - _LOGGER.debug(f"Charge stop recorded for {serial}") + _LOGGER.debug(f"Charge stop recorded for {serial}") # --- Utility exposure for UI / sensors --- def get_cooldown_remaining(self, serial: str) -> timedelta: From 887a4993b630120a92f0d8030e23aa11f54b5783 Mon Sep 17 00:00:00 2001 From: Tobias Feld Date: Fri, 30 Jan 2026 16:00:01 +0100 Subject: [PATCH 3/3] Update __init__.py --- custom_components/evsemasterudp/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/custom_components/evsemasterudp/__init__.py b/custom_components/evsemasterudp/__init__.py index 5a7ad3a..08539c9 100644 --- a/custom_components/evsemasterudp/__init__.py +++ b/custom_components/evsemasterudp/__init__.py @@ -58,8 +58,8 @@ async def _async_update_data(self): async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up the EVSE integration from a config entry""" - # Check if this is the first time setup - is_first_setup = entry.entry_id not in hass.data.get(DOMAIN, {}) + # Check if this entry has been set up before using options + is_first_setup = not entry.options.get("setup_complete", False) # Retrieve configuration parameters serial = entry.data.get("serial") @@ -119,6 +119,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: # Notification recommending a restart after installation/update if is_first_setup: + # Mark this entry as configured by updating options + hass.config_entries.async_update_entry( + entry, + options={**entry.options, "setup_complete": True} + ) + create( hass, f"EVSE Master UDP successfully configured for EVSE {serial}.\n\n"