Browse Source

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

nas 3 years ago
parent
commit
d64fd414d6
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      pyheatpump/modbus.py

+ 1
- 1
pyheatpump/modbus.py View File

@@ -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…
Cancel
Save