Y13 is Y11
This commit is contained in:
+3
-3
@@ -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
|
||||
@@ -298,4 +298,4 @@ class HvService:
|
||||
else:
|
||||
logger.info(f"成功发布设备数据: {data}")
|
||||
except Exception as e:
|
||||
logger.error(f"处理设备 {hvs_device.get('code')} 数据失败: {e}")
|
||||
logger.error(f"处理设备 {hvs_device.get('code')} 数据失败: {e}")
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user