Skip to content

Commit

Permalink
Merge pull request #83 from nobbi1991/release_fixes
Browse files Browse the repository at this point in the history
set release date
  • Loading branch information
nobbi1991 authored Oct 6, 2024
2 parents bce7a4d + 24b2385 commit edfdd70
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 32 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version 6.2.0 - dd.10.2024
# Version 6.2.0 - 06.10.2024

## Features

Expand All @@ -11,6 +11,7 @@
## Bugfix

- fixed bug in ``habapp_rules.actors.light.LightSwitchExtended`` and ``habapp_rules.actors.light.LightDimmerExtended`` which did not re-trigger the timer if a door was opened.
- fixed bug in all rules of ``habapp_rules.actors.light`` where a timer with time=None was used if a light function is not active. Now, the time is changed to 0 sec if a function is not configured.

# Version 6.1.0 - 19.08.2024

Expand Down
30 changes: 15 additions & 15 deletions habapp_rules/actors/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,20 @@ def _set_timeouts(self) -> None:
"""Set timeouts depending on the current day/night/sleep state."""
if self._get_sleeping_activ():
self._timeout_on = self._config.parameter.on.sleeping.timeout
self._timeout_pre_off = getattr(self._config.parameter.pre_off.sleeping if self._config.parameter.pre_off else None, "timeout", None)
self._timeout_leaving = getattr(self._config.parameter.leaving.sleeping if self._config.parameter.leaving else None, "timeout", None)
self._timeout_pre_sleep = None
self._timeout_pre_off = getattr(self._config.parameter.pre_off.sleeping if self._config.parameter.pre_off else 0, "timeout", 0)
self._timeout_leaving = getattr(self._config.parameter.leaving.sleeping if self._config.parameter.leaving else 0, "timeout", 0)
self._timeout_pre_sleep = 0

elif self._config.items.day.is_on():
self._timeout_on = self._config.parameter.on.day.timeout
self._timeout_pre_off = getattr(self._config.parameter.pre_off.day if self._config.parameter.pre_off else None, "timeout", None)
self._timeout_leaving = getattr(self._config.parameter.leaving.day if self._config.parameter.leaving else None, "timeout", None)
self._timeout_pre_sleep = getattr(self._config.parameter.pre_sleep.day if self._config.parameter.pre_sleep else None, "timeout", None)
self._timeout_pre_off = getattr(self._config.parameter.pre_off.day if self._config.parameter.pre_off else 0, "timeout", 0)
self._timeout_leaving = getattr(self._config.parameter.leaving.day if self._config.parameter.leaving else 0, "timeout", 0)
self._timeout_pre_sleep = getattr(self._config.parameter.pre_sleep.day if self._config.parameter.pre_sleep else 0, "timeout", 0)
else:
self._timeout_on = self._config.parameter.on.night.timeout
self._timeout_pre_off = getattr(self._config.parameter.pre_off.night if self._config.parameter.pre_off else None, "timeout", None)
self._timeout_leaving = getattr(self._config.parameter.leaving.night if self._config.parameter.leaving else None, "timeout", None)
self._timeout_pre_sleep = getattr(self._config.parameter.pre_sleep.night if self._config.parameter.pre_sleep else None, "timeout", None)
self._timeout_pre_off = getattr(self._config.parameter.pre_off.night if self._config.parameter.pre_off else 0, "timeout", 0)
self._timeout_leaving = getattr(self._config.parameter.leaving.night if self._config.parameter.leaving else 0, "timeout", 0)
self._timeout_pre_sleep = getattr(self._config.parameter.pre_sleep.night if self._config.parameter.pre_sleep else 0, "timeout", 0)

self.state_machine.states["auto"].states["on"].timeout = self._timeout_on
self.state_machine.states["auto"].states["preoff"].timeout = self._timeout_pre_off
Expand Down Expand Up @@ -612,15 +612,15 @@ def _set_timeouts(self) -> None:

# set timeouts of additional states
if self._get_sleeping_activ():
self._timeout_motion = getattr(self._config.parameter.motion.sleeping if self._config.parameter.motion else None, "timeout", None)
self._timeout_door = getattr(self._config.parameter.door.sleeping if self._config.parameter.door else None, "timeout", None)
self._timeout_motion = getattr(self._config.parameter.motion.sleeping if self._config.parameter.motion else 0, "timeout", 0)
self._timeout_door = getattr(self._config.parameter.door.sleeping if self._config.parameter.door else 0, "timeout", 0)

elif self._config.items.day.is_on():
self._timeout_motion = getattr(self._config.parameter.motion.day if self._config.parameter.motion else None, "timeout", None)
self._timeout_door = getattr(self._config.parameter.door.day if self._config.parameter.door else None, "timeout", None)
self._timeout_motion = getattr(self._config.parameter.motion.day if self._config.parameter.motion else 0, "timeout", 0)
self._timeout_door = getattr(self._config.parameter.door.day if self._config.parameter.door else 0, "timeout", 0)
else:
self._timeout_motion = getattr(self._config.parameter.motion.night if self._config.parameter.motion else None, "timeout", None)
self._timeout_door = getattr(self._config.parameter.door.night if self._config.parameter.door else None, "timeout", None)
self._timeout_motion = getattr(self._config.parameter.motion.night if self._config.parameter.motion else 0, "timeout", 0)
self._timeout_door = getattr(self._config.parameter.door.night if self._config.parameter.door else 0, "timeout", 0)

self.state_machine.states["auto"].states["motion"].timeout = self._timeout_motion
self.state_machine.states["auto"].states["door"].timeout = self._timeout_door
Expand Down
Binary file modified tests/actors/Shading_States/Shading_Auto_Init.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/actors/VentilationHeliosTwoStage_States/Ventilation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/actors/Ventilation_States/Ventilation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/actors/Ventilation_States/Ventilation_Auto_PowerHand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions tests/actors/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,14 @@ def test_set_timeouts(self):

test_cases = [
TestCase(light_config_max, False, False, 5, 1, 15, 7),
TestCase(light_config_max, False, True, 2, None, None, None),
TestCase(light_config_max, True, False, 10, 4, None, None),
TestCase(light_config_max, True, True, 2, None, None, None),

TestCase(light_config_min, False, False, 5, None, None, None),
TestCase(light_config_min, False, True, 2, None, None, None),
TestCase(light_config_min, True, False, 10, None, None, None),
TestCase(light_config_min, True, True, 2, None, None, None),
TestCase(light_config_max, False, True, 2, 0, 0, 0),
TestCase(light_config_max, True, False, 10, 4, 0, 0),
TestCase(light_config_max, True, True, 2, 0, 0, 0),

TestCase(light_config_min, False, False, 5, 0, 0, 0),
TestCase(light_config_min, False, True, 2, 0, 0, 0),
TestCase(light_config_min, True, False, 10, 0, 0, 0),
TestCase(light_config_min, True, True, 2, 0, 0, 0),
]

for test_case in test_cases:
Expand Down Expand Up @@ -1563,14 +1563,14 @@ def test_set_timeouts(self):

test_cases = [
TestCase(light_config_max, False, False, 5, 1, 15, 7, 20, 21),
TestCase(light_config_max, False, True, 2, None, None, None, 9, 8),
TestCase(light_config_max, True, False, 10, 4, None, None, None, None),
TestCase(light_config_max, True, True, 2, None, None, None, 9, 8),

TestCase(light_config_min, False, False, 5, None, None, None, None, None),
TestCase(light_config_min, False, True, 2, None, None, None, None, None),
TestCase(light_config_min, True, False, 10, None, None, None, None, None),
TestCase(light_config_min, True, True, 2, None, None, None, None, None),
TestCase(light_config_max, False, True, 2, 0, 0, 0, 9, 8),
TestCase(light_config_max, True, False, 10, 4, 0, 0, 0, 0),
TestCase(light_config_max, True, True, 2, 0, 0, 0, 9, 8),

TestCase(light_config_min, False, False, 5, 0, 0, 0, 0, 0),
TestCase(light_config_min, False, True, 2, 0, 0, 0, 0, 0),
TestCase(light_config_min, True, False, 10, 0, 0, 0, 0, 0),
TestCase(light_config_min, True, True, 2, 0, 0, 0, 0, 0),
]

for test_case in test_cases:
Expand Down

0 comments on commit edfdd70

Please sign in to comment.