Explorar el Código

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

nas hace 3 años
padre
commit
d64fd414d6
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      pyheatpump/modbus.py

+ 1
- 1
pyheatpump/modbus.py Ver fichero

@@ -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…
Cancelar
Guardar