Compare commits

...
1 Commits
Author SHA1 Message Date
leon 8d0f57763a Y13 is Y11 2026-09-13 10:41:08 +08:00
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ class HvService:
if value == 1:
self.modbus_client.write_coil(slave_id, 0x00, True)
self.modbus_client.write_coil(slave_id, 0x01, True)
self.modbus_client.write_holding_register(slave_id, 0x00, 1000)
self.modbus_client.write_holding_register(slave_id, 0x00, 6000)
else:
self.modbus_client.write_coil(slave_id, 0x01, False)
@@ -133,7 +133,7 @@ class HvService:
"""处理UDP消息(留空,由外部实现)"""
try:
info = json.loads(data.decode())
logger.info(f"收到UDP消息: {info}")
#logger.info(f"收到UDP消息: {info}")
if 'id' in info:
id = int(info['id'][0])
self.filament_info[id - 1] = info
+3 -3
View File
@@ -57,13 +57,13 @@ def main():
time.sleep(0.1)
if time.time() - last_valve_time > valve_off_time:
io_module.control_valve(13, True)
io_module.control_valve(11, True)
time.sleep(valve_on_time)
io_module.control_valve(13, False)
io_module.control_valve(11, False)
last_valve_time = time.time()
except KeyboardInterrupt:
print("程序收到中断信号,正在退出...")
io_module.control_valve(13, False)
io_module.control_valve(11, False)
io_module.stop()
hv_service.stop()
mqtt_client.stop()