Skip to content

Commit

Permalink
Initial POC for coil writing.
Browse files Browse the repository at this point in the history
  • Loading branch information
r-xyz committed May 31, 2024
1 parent fc3376b commit 84271f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modbus4mqtt/modbus_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 84271f4

Please sign in to comment.