Релейный модуль работает не так как я думал
This commit is contained in:
+5
-7
@@ -116,8 +116,7 @@ def check_temperatures():
|
||||
# turn on the pump
|
||||
# and turn off the boiler of course
|
||||
for c in contours:
|
||||
# valves are normally-opened, so 0 means "open"
|
||||
mqtt_client.publish(c.out_topic, "0", retain=True)
|
||||
mqtt_client.publish(c.out_topic, "1", retain=True)
|
||||
mqtt_client.publish(boiler_control, "0", retain=True)
|
||||
mqtt_client.publish(pump_control, "1", retain=True)
|
||||
return
|
||||
@@ -133,8 +132,7 @@ def check_temperatures():
|
||||
if count_t == 0:
|
||||
logger.error("No temperatures available, switch to full-on mode")
|
||||
for c in contours:
|
||||
# valves are normally-opened, so 0 means "open"
|
||||
mqtt_client.publish(c.out_topic, "0", retain=True)
|
||||
mqtt_client.publish(c.out_topic, "1", retain=True)
|
||||
# turn on boiler
|
||||
mqtt_client.publish(boiler_control, "1", retain=True)
|
||||
return
|
||||
@@ -155,10 +153,10 @@ def check_temperatures():
|
||||
# should turn off contour
|
||||
c.check_state(False)
|
||||
if c.state:
|
||||
# 0 means "open"
|
||||
mqtt_client.publish(c.out_topic, "0", retain=True)
|
||||
else:
|
||||
# 0 means "closed"
|
||||
mqtt_client.publish(c.out_topic, "1", retain=True)
|
||||
else:
|
||||
mqtt_client.publish(c.out_topic, "0", retain=True)
|
||||
|
||||
if any_opened:
|
||||
any_opened = False
|
||||
|
||||
Reference in New Issue
Block a user