diff --git a/custom_components/pentair_cloud/pentaircloud.py b/custom_components/pentair_cloud/pentaircloud.py index 8669514..0d1d1d4 100644 --- a/custom_components/pentair_cloud/pentaircloud.py +++ b/custom_components/pentair_cloud/pentaircloud.py @@ -408,8 +408,18 @@ def start_program(self, deviceId: str, program_id: int) -> None: + " on device " + deviceId ) - if device.active_program is not None: # Stop previous program - self.stop_program(deviceId, device.active_program) + if device.active_program is not None: + # Live-swap: mark the old program stopped LOCALLY only, without + # sending an explicit stop_program() API call. The pump's own + # firmware handles the transition as a smooth in-place profile + # swap when a new program is enabled directly (confirmed by + # physical observation: the official Pentair app does not stop + # /restart the pump when switching between two running + # programs - only this integration's prior stop-then-start + # sequence forced a hard ~30s restart). + for old_program in device.programs: + if old_program.id == device.active_program: + old_program.running = False device.last_program_start = time.time() self.populate_AWS_token() if self.AWS_TOKEN is not None: