aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2019-03-12 22:44:40 (GMT)
committerSean Young <sean@mess.org>2019-03-13 09:42:10 (GMT)
commit5621909288fafdb74b65180c9c0f615d594d4e0b (patch)
tree39d668f9d3dfd80bfabf7e8fb90597cf037a872a
parentb6c13019f4879eb3e17b70dd8b4f68559928b0c6 (diff)
lircd2toml: toggle_bit is offset from bits including pre-data
This causes the following lircd.conf to be converted incorrectly. http://lirc.sourceforge.net/remotes/cambridge_audio/X40A Signed-off-by: Sean Young <sean@mess.org>
-rwxr-xr-xcontrib/lircd2toml.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/lircd2toml.py b/contrib/lircd2toml.py
index f9408ec..72ee50e 100755
--- a/contrib/lircd2toml.py
+++ b/contrib/lircd2toml.py
@@ -404,18 +404,18 @@ class Converter:
bits = int(self.remote['bits'][0])
- toggle_bit = 0
- if 'toggle_bit_mask' in self.remote:
- toggle_bit = ffs(int(self.remote['toggle_bit_mask'][0]))
- if 'toggle_bit' in self.remote:
- toggle_bit = bits - int(self.remote['toggle_bit'][0])
-
pre_data = 0
if 'pre_data_bits' in self.remote:
pre_data_bits = int(self.remote['pre_data_bits'][0])
pre_data = int(self.remote['pre_data'][0]) << bits
bits += pre_data_bits
+ toggle_bit = 0
+ if 'toggle_bit_mask' in self.remote:
+ toggle_bit = ffs(int(self.remote['toggle_bit_mask'][0]))
+ if 'toggle_bit' in self.remote:
+ toggle_bit = bits - int(self.remote['toggle_bit'][0])
+
if 'plead' in self.remote:
plead = self.remote['plead'][0]
one_pulse = self.remote['one'][0]

Privacy Policy