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 <noreply@anthropic.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user