From 2b65516b6cf7e63335aaefc0059d218231d3dece Mon Sep 17 00:00:00 2001 From: kwindrem <58538395+kwindrem@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:41:06 -0700 Subject: [PATCH] generator will not restart on enableing auto start --- FileSets/v2.73/startstop.py | 12 +++++++++--- FileSets/v3.01/startstop.py | 14 ++++++++++---- FileSets/v3.10/startstop.py | 14 ++++++++++---- FileSets/v3.14/startstop.py | 14 ++++++++++---- FileSets/v3.31/startstop.py | 14 ++++++++++---- FileSets/v3.40~30/startstop.py | 17 +++++++++++++---- changes | 7 +++++++ version | 2 +- 8 files changed, 70 insertions(+), 24 deletions(-) diff --git a/FileSets/v2.73/startstop.py b/FileSets/v2.73/startstop.py index c056feea..fa1f2ee0 100755 --- a/FileSets/v2.73/startstop.py +++ b/FileSets/v2.73/startstop.py @@ -420,9 +420,9 @@ def _evaluate_startstop_conditions(self): if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1: self._dbusservice['/ManualStartTimer'] = 0 self._dbusservice['/ManualStart'] = 0 - ignoresAutoStartCondition = True + ignoreAutoStartCondition = True else: - ignoresAutoStartCondition = False + ignoreAutoStartCondition = False if self._evaluate_manual_start(): startbycondition = 'manual' start = True @@ -437,7 +437,7 @@ def _evaluate_startstop_conditions(self): # Evaluate value conditions for condition in conditions: #### GuiMods - start = self._evaluate_condition(self._condition_stack[condition], values[condition], ignoresAutoStartCondition) or start + start = self._evaluate_condition(self._condition_stack[condition], values[condition], ignoreAutoStartCondition) or start startbycondition = condition if start and startbycondition is None else startbycondition # Connection lost is set to true if the number of retries of one or more enabled conditions @@ -462,6 +462,12 @@ def _evaluate_startstop_conditions(self): start = True startbycondition = 'lossofcommunication' +#### GuiMods + ## auto start disabled and generator is stopped - clear the 'reached' flags + elif self._dbusservice['/State'] == States.STOPPED: + for condition, data in self._condition_stack.items(): + self._reset_condition(data) + if not start and self._errorstate: self._stop_generator() diff --git a/FileSets/v3.01/startstop.py b/FileSets/v3.01/startstop.py index 22728f6f..db452ba2 100644 --- a/FileSets/v3.01/startstop.py +++ b/FileSets/v3.01/startstop.py @@ -403,7 +403,7 @@ def _create_service(self): self._dbusservice.add_path('/ExternalOverride', value=None) self._dbusservice['/GeneratorRunningState'] = "?" self._dbusservice['/ExternalOverride'] = False - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False @property def capabilities(self): @@ -608,9 +608,9 @@ def _evaluate_startstop_conditions(self): if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1: self._dbusservice['/ManualStartTimer'] = 0 self._dbusservice['/ManualStart'] = 0 - self._ignoresAutoStartCondition = True + self._ignoreAutoStartCondition = True else: - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False if self._evaluate_manual_start(): startbycondition = 'manual' start = True @@ -651,6 +651,12 @@ def _evaluate_startstop_conditions(self): start = True startbycondition = 'lossofcommunication' +#### GuiMods + ## auto start disabled and generator is stopped - clear the 'reached' flags + elif self._dbusservice['/State'] == States.STOPPED: + for condition, data in self._condition_stack.items(): + self._reset_condition(data) + if not start and self._errorstate: self._stop_generator() @@ -800,7 +806,7 @@ def _evaluate_condition(self, condition): stop = value <= stopvalue if start_is_greater else value >= stopvalue # when starting manually and stopping based on auto stop values, # start if stop condition is not satisfied - if self._ignoresAutoStartCondition: + if self._ignoreAutoStartCondition: start = not stop else: # When the condition is already reached only the stop value can set it to False diff --git a/FileSets/v3.10/startstop.py b/FileSets/v3.10/startstop.py index 086fd2f7..2344c338 100644 --- a/FileSets/v3.10/startstop.py +++ b/FileSets/v3.10/startstop.py @@ -424,7 +424,7 @@ def _create_service(self): self._dbusservice.add_path('/ExternalOverride', value=None) self._dbusservice['/GeneratorRunningState'] = "?" self._dbusservice['/ExternalOverride'] = False - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False @property def capabilities(self): @@ -647,9 +647,9 @@ def _evaluate_startstop_conditions(self): if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1: self._dbusservice['/ManualStartTimer'] = 0 self._dbusservice['/ManualStart'] = 0 - self._ignoresAutoStartCondition = True + self._ignoreAutoStartCondition = True else: - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False if self._evaluate_manual_start(): startbycondition = 'manual' start = True @@ -703,6 +703,12 @@ def _evaluate_startstop_conditions(self): start = True startbycondition = 'lossofcommunication' +#### GuiMods + ## auto start disabled and generator is stopped - clear the 'reached' flags + elif self._dbusservice['/State'] == States.STOPPED: + for condition, data in self._condition_stack.items(): + self._reset_condition(data) + if not start and self._errorstate: self._stop_generator() @@ -866,7 +872,7 @@ def _evaluate_condition(self, condition): stop = value <= stopvalue if start_is_greater else value >= stopvalue # when starting manually and stopping based on auto stop values, # start if stop condition is not satisfied - if self._ignoresAutoStartCondition: + if self._ignoreAutoStartCondition: start = not stop else: # When the condition is already reached only the stop value can set it to False diff --git a/FileSets/v3.14/startstop.py b/FileSets/v3.14/startstop.py index 438ccc46..372d2879 100644 --- a/FileSets/v3.14/startstop.py +++ b/FileSets/v3.14/startstop.py @@ -424,7 +424,7 @@ def _create_service(self): self._dbusservice.add_path('/ExternalOverride', value=None) self._dbusservice['/GeneratorRunningState'] = "?" self._dbusservice['/ExternalOverride'] = False - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False @property def capabilities(self): @@ -648,9 +648,9 @@ def _evaluate_startstop_conditions(self): if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1: self._dbusservice['/ManualStartTimer'] = 0 self._dbusservice['/ManualStart'] = 0 - self._ignoresAutoStartCondition = True + self._ignoreAutoStartCondition = True else: - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False if self._evaluate_manual_start(): startbycondition = 'manual' start = True @@ -704,6 +704,12 @@ def _evaluate_startstop_conditions(self): start = True startbycondition = 'lossofcommunication' +#### GuiMods + ## auto start disabled and generator is stopped - clear the 'reached' flags + elif self._dbusservice['/State'] == States.STOPPED: + for condition, data in self._condition_stack.items(): + self._reset_condition(data) + if not start and self._errorstate: self._stop_generator() @@ -869,7 +875,7 @@ def _evaluate_condition(self, condition): stop = value <= stopvalue if start_is_greater else value >= stopvalue # when starting manually and stopping based on auto stop values, # start if stop condition is not satisfied - if self._ignoresAutoStartCondition: + if self._ignoreAutoStartCondition: start = not stop else: # When the condition is already reached only the stop value can set it to False diff --git a/FileSets/v3.31/startstop.py b/FileSets/v3.31/startstop.py index 112bdc03..f54c1e47 100644 --- a/FileSets/v3.31/startstop.py +++ b/FileSets/v3.31/startstop.py @@ -429,7 +429,7 @@ def _create_service(self): self._dbusservice.add_path('/ExternalOverride', value=None) self._dbusservice['/GeneratorRunningState'] = "?" self._dbusservice['/ExternalOverride'] = False - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False @property def capabilities(self): @@ -658,9 +658,9 @@ def _evaluate_startstop_conditions(self): if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1: self._dbusservice['/ManualStartTimer'] = 0 self._dbusservice['/ManualStart'] = 0 - self._ignoresAutoStartCondition = True + self._ignoreAutoStartCondition = True else: - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False if self._evaluate_manual_start(): startbycondition = 'manual' start = True @@ -714,6 +714,12 @@ def _evaluate_startstop_conditions(self): start = True startbycondition = 'lossofcommunication' +#### GuiMods + ## auto start disabled and generator is stopped - clear the 'reached' flags + elif self._dbusservice['/State'] == States.STOPPED: + for condition, data in self._condition_stack.items(): + self._reset_condition(data) + if not start and self._errorstate: self._stop_generator() @@ -879,7 +885,7 @@ def _evaluate_condition(self, condition): stop = value <= stopvalue if start_is_greater else value >= stopvalue # when starting manually and stopping based on auto stop values, # start if stop condition is not satisfied - if self._ignoresAutoStartCondition: + if self._ignoreAutoStartCondition: start = not stop else: # When the condition is already reached only the stop value can set it to False diff --git a/FileSets/v3.40~30/startstop.py b/FileSets/v3.40~30/startstop.py index 4103adc1..fcb79154 100644 --- a/FileSets/v3.40~30/startstop.py +++ b/FileSets/v3.40~30/startstop.py @@ -431,7 +431,8 @@ def _create_service(self): self._dbusservice.add_path('/ExternalOverride', value=None) self._dbusservice['/GeneratorRunningState'] = "?" self._dbusservice['/ExternalOverride'] = False - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False + @property def capabilities(self): @@ -644,9 +645,10 @@ def _evaluate_startstop_conditions(self): if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1: self._dbusservice['/ManualStartTimer'] = 0 self._dbusservice['/ManualStart'] = 0 - self._ignoresAutoStartCondition = True + self._ignoreAutoStartCondition = True + else: - self._ignoresAutoStartCondition = False + self._ignoreAutoStartCondition = False if self._evaluate_manual_start(): startbycondition = 'manual' start = True @@ -700,6 +702,12 @@ def _evaluate_startstop_conditions(self): start = True startbycondition = 'lossofcommunication' +#### GuiMods + ## auto start disabled and generator is stopped - clear the 'reached' flags + elif self._dbusservice['/State'] == States.STOPPED: + for condition, data in self._condition_stack.items(): + self._reset_condition(data) + if not start and self._errorstate: self._stop_generator() @@ -883,7 +891,8 @@ def _evaluate_condition(self, condition): stop = value <= stopvalue if start_is_greater else value >= stopvalue # when starting manually and stopping based on auto stop values, # start if stop condition is not satisfied - if self._ignoresAutoStartCondition: + + if self._ignoreAutoStartCondition: start = not stop else: # When the condition is already reached only the stop value can set it to False diff --git a/changes b/changes index 9eb51006..5f24376e 100644 --- a/changes +++ b/changes @@ -1,3 +1,10 @@ +v10.48: + changed behavior: previously, if the generator auto starts then auto start is disabled + the generator will restart if auto start is reenabled + unless all stop conditions have been met + now, reenabling auto start will NOT restart the generator + if no start conditions are active + v10.47: more fixes for missing Multi tile diff --git a/version b/version index efe7098a..2a88630e 100644 --- a/version +++ b/version @@ -1 +1 @@ -v10.44 +v10.48