瀏覽代碼

pairprogramming : cast de booléens vers les hexa attendu par modbus

nas 3 年之前
父節點
當前提交
d64fd414d6
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      pyheatpump/modbus.py

+ 1
- 1
pyheatpump/modbus.py 查看文件

@@ -103,7 +103,7 @@ def read_holding_registers(start, end):
103 103
 def write_coil(var_value):
104 104
     global serial_conn
105 105
     connect()
106
-
106
+    var_value.value = int(var_value) * 0xFF00
107 107
     logger.debug('write_coil address: %s, value: %s',
108 108
         var_value.address, var_value.value
109 109
     )

Loading…
取消
儲存