From 8ba3e1c3370cb607207db7c83350932b75fb7f93 Mon Sep 17 00:00:00 2001 From: ems-agent Date: Wed, 18 Nov 2026 00:29:05 +0100 Subject: [PATCH] EV-05: shutdown keeps one command_site_release() call site CI run 1737: test_sma10_two_idle_states counts the call lines of command_site_release() in main.py (the Stop button and shutdown, 2); the Solar-first branch had made it 3. Same order as before: in Solar the charger's 0 A first, in Manual the inverters first. Co-Authored-By: Claude --- goodwe_controller/app/main.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/goodwe_controller/app/main.py b/goodwe_controller/app/main.py index c35c1b5..0d25862 100644 --- a/goodwe_controller/app/main.py +++ b/goodwe_controller/app/main.py @@ -1040,14 +1040,15 @@ class Controller(InputsMixin, WritesMixin, TradeMixin, CycleMixin, AlarmsMixin, self.stopping = True _LOG.info(handback.log_shutdown(handback.current()) or "shutting down - commanding 0 W on every inverter") - if self.car_solar_engaged(): - # EV-05: Solar's fail state is 0 A, and it goes out BEFORE the - # inverters go to 0 W (bounded by `ctl_car.RELEASE_WAIT_S`). + # EV-05: Solar's fail state is 0 A, and it goes out BEFORE the + # inverters go to 0 W (bounded by `ctl_car.RELEASE_WAIT_S`). Manual + # keeps EV-04's order: the inverters first, then undo a phase change. + solar = self.car_solar_engaged() + if solar: + await self.car_shutdown() + await self.command_site_release() + if not solar: await self.car_shutdown() - await self.command_site_release() - else: - await self.command_site_release() - await self.car_shutdown() # EV-04: undo a phase change half way self.mqtt.close()