From 0e638e4c3a9d48051c9af55c41ffd34e147ea699 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sun, 11 Jun 2023 21:33:56 +0000 Subject: [PATCH] +1 --- .../solar_optimizer/simulated_annealing_algo.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/custom_components/solar_optimizer/simulated_annealing_algo.py b/custom_components/solar_optimizer/simulated_annealing_algo.py index 508c194..0cd85aa 100644 --- a/custom_components/solar_optimizer/simulated_annealing_algo.py +++ b/custom_components/solar_optimizer/simulated_annealing_algo.py @@ -259,12 +259,18 @@ def permuter_equipement(self, solution): # if not can_change_power and is_waiting: # -> on ne fait rien (mais ne devrait pas arriver car il ne serait pas usable dans ce cas) # - # if not state or not can_change_power: - # -> allumage ou extinction - # # if state and can_change_power and is_waiting: # -> change power mais sans l'éteindre (requested_power >= power_min) # + # if state and can_change_power and not is_waiting: + # -> change power avec extinction possible + # + # if not state and not is_waiting + # -> allumage + # + # if state and not is_waiting + # -> extinction + # if not state or not can_change_power: eqt["state"] = not state # We always start at the min power