fix: v1.5.7 исправил архитектуру управления температурой. Теперь отдельный контроллер отвечает за нагрев для всех режимов авто ручной или временный ручной. Раньше в каждом режиме была своя логика.
This commit is contained in:
@@ -134,7 +134,7 @@ def load_test_schedule():
|
||||
return temp_dir, config
|
||||
|
||||
|
||||
def heater_calls(calls):
|
||||
def temperature_calls(calls):
|
||||
return [
|
||||
call
|
||||
for call in calls
|
||||
@@ -142,6 +142,7 @@ def heater_calls(calls):
|
||||
"heater_on",
|
||||
"heater_off",
|
||||
"set_heater",
|
||||
"set_target_temperature",
|
||||
}
|
||||
]
|
||||
|
||||
@@ -178,7 +179,12 @@ async def test_auto_does_not_control_heater():
|
||||
# 09:30
|
||||
#
|
||||
# Обычный SET.
|
||||
# heater=on должен принадлежать ScheduleService.
|
||||
#
|
||||
# ScheduleService хранит желаемое heater=on,
|
||||
# но физически heater управлять НЕ должен.
|
||||
#
|
||||
# Физический heater будет принадлежать
|
||||
# единому температурному регулятору.
|
||||
# --------------------------------------------------
|
||||
|
||||
await process_at(
|
||||
@@ -198,12 +204,13 @@ async def test_auto_does_not_control_heater():
|
||||
tion.controller.calls,
|
||||
)
|
||||
|
||||
calls = heater_calls(
|
||||
calls = temperature_calls(
|
||||
tion.controller.calls
|
||||
)
|
||||
|
||||
assert calls != [], (
|
||||
"SET must control heater"
|
||||
assert calls == [], (
|
||||
"ScheduleService must not control "
|
||||
"heater or target temperature during SET"
|
||||
)
|
||||
|
||||
tion.controller.calls.clear()
|
||||
@@ -263,13 +270,13 @@ async def test_auto_does_not_control_heater():
|
||||
tion.controller.calls,
|
||||
)
|
||||
|
||||
calls = heater_calls(
|
||||
calls = temperature_calls(
|
||||
tion.controller.calls
|
||||
)
|
||||
|
||||
assert calls == [], (
|
||||
"ScheduleService must not control "
|
||||
"heater during AUTO"
|
||||
"heater or target temperature during AUTO"
|
||||
)
|
||||
|
||||
tion.controller.calls.clear()
|
||||
@@ -298,13 +305,13 @@ async def test_auto_does_not_control_heater():
|
||||
tion.controller.calls,
|
||||
)
|
||||
|
||||
calls = heater_calls(
|
||||
calls = temperature_calls(
|
||||
tion.controller.calls
|
||||
)
|
||||
|
||||
assert calls != [], (
|
||||
"ScheduleService must regain heater "
|
||||
"control after AUTO"
|
||||
assert calls == [], (
|
||||
"ScheduleService must not control "
|
||||
"heater or target temperature after AUTO"
|
||||
)
|
||||
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user