Skip to content

Commit

Permalink
Fix 433.92 MHz 32-bit protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppeg88 authored Feb 18, 2018
1 parent 6c81df1 commit 121a07d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rpi_rf/rpi_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ def tx_code(self, code, tx_proto=None, tx_pulselength=None):
self.tx_pulselength = tx_pulselength
else:
self.tx_pulselength = PROTOCOLS[self.tx_proto].pulselength

"""Set tx_length depending on code value"""
if (code < 16777216):
self.tx_length = 24
else:
self.tx_length = 32

rawcode = format(code, '#0{}b'.format(self.tx_length + 2))[2:]
_LOGGER.debug("TX code: " + str(code))
return self.tx_bin(rawcode)
Expand Down

0 comments on commit 121a07d

Please sign in to comment.