fix: v1.5.2 изменил логику нагрева, теперь нагрев включается по датчику qingping а не тион. Если он недоступен то по тиону.
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
from app.auto.controller import AutoController
|
||||
|
||||
|
||||
def main() -> None:
|
||||
controller = object.__new__(
|
||||
AutoController
|
||||
)
|
||||
|
||||
controller._manual_heater_enabled = None
|
||||
controller._manual_target_temperature = None
|
||||
controller._manual_heating = None
|
||||
|
||||
print("Initial:")
|
||||
print(
|
||||
{
|
||||
"enabled": controller._manual_heater_enabled,
|
||||
"target_temp": controller._manual_target_temperature,
|
||||
"heating": controller._manual_heating,
|
||||
}
|
||||
)
|
||||
|
||||
controller.set_manual_heater_enabled(
|
||||
True
|
||||
)
|
||||
|
||||
controller.set_manual_target_temperature(
|
||||
23
|
||||
)
|
||||
|
||||
print("After enable + target 23:")
|
||||
print(
|
||||
{
|
||||
"enabled": controller.manual_heater_enabled,
|
||||
"target_temp": controller.manual_target_temperature,
|
||||
"heating": controller._manual_heating,
|
||||
}
|
||||
)
|
||||
|
||||
assert (
|
||||
controller.manual_heater_enabled
|
||||
is True
|
||||
)
|
||||
|
||||
assert (
|
||||
controller.manual_target_temperature
|
||||
== 23
|
||||
)
|
||||
|
||||
assert (
|
||||
controller._manual_heating
|
||||
is None
|
||||
)
|
||||
|
||||
controller.set_manual_heater_enabled(
|
||||
False
|
||||
)
|
||||
|
||||
print("After heater OFF:")
|
||||
print(
|
||||
{
|
||||
"enabled": controller.manual_heater_enabled,
|
||||
"target_temp": controller.manual_target_temperature,
|
||||
"heating": controller._manual_heating,
|
||||
}
|
||||
)
|
||||
|
||||
assert (
|
||||
controller.manual_heater_enabled
|
||||
is False
|
||||
)
|
||||
|
||||
assert (
|
||||
controller._manual_heating
|
||||
is False
|
||||
)
|
||||
|
||||
controller.clear_manual_heater_control()
|
||||
|
||||
print("After clear:")
|
||||
print(
|
||||
{
|
||||
"enabled": controller.manual_heater_enabled,
|
||||
"target_temp": controller.manual_target_temperature,
|
||||
"heating": controller._manual_heating,
|
||||
}
|
||||
)
|
||||
|
||||
assert (
|
||||
controller.manual_heater_enabled
|
||||
is None
|
||||
)
|
||||
|
||||
assert (
|
||||
controller.manual_target_temperature
|
||||
is None
|
||||
)
|
||||
|
||||
assert (
|
||||
controller._manual_heating
|
||||
is None
|
||||
)
|
||||
|
||||
print("TEST PASSED")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user