diff --git a/modbus4mqtt/modbus_interface.py b/modbus4mqtt/modbus_interface.py index 477fcd5..350b2e4 100644 --- a/modbus4mqtt/modbus_interface.py +++ b/modbus4mqtt/modbus_interface.py @@ -161,6 +161,9 @@ def get_value(self, table, addr, type='uint16'): return value def set_value(self, table, addr, value, mask=0xFFFF, type='uint16'): + if table == 'coils': + self._mb.write_coil(addr, value) + return if table != 'holding': # I'm not sure if this is true for all devices. I might support writing to coils later, # so leave this door open.