diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2018-04-08 18:44:09 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2018-04-08 19:09:02 +0200 |
commit | e7b18ee369eb1fd1bf02639fd23de3657683d12b (patch) | |
tree | db0912f30bdb3a744183e9e8ae6e26e116fbfc06 | |
parent | 8c8cb5917e7bf029042f2161673b3cef3c2a6835 (diff) | |
download | libsigrokdecode-e7b18ee369eb1fd1bf02639fd23de3657683d12b.tar.gz libsigrokdecode-e7b18ee369eb1fd1bf02639fd23de3657683d12b.zip |
rc_encode: Use += operator where possible.
-rw-r--r-- | decoders/rc_encode/pd.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/decoders/rc_encode/pd.py b/decoders/rc_encode/pd.py index 902594c..b57c0ad 100644 --- a/decoders/rc_encode/pd.py +++ b/decoders/rc_encode/pd.py @@ -53,20 +53,19 @@ def decode_model(model, bits): if model == 'maplin_l95ar': address = 'Addr' # Address pins A0 to A5 for i in range(0, 6): - address = address + ' %i:' % (i + 1) + \ - ('on' if bits[i][0] == '0' else 'off') + address += ' %i:' % (i + 1) + ('on' if bits[i][0] == '0' else 'off') button = 'Button' # Button pins A6/D5 to A11/D0 if bits[6][0] == '0' and bits[11][0] == '0': - button = button + ' A ON/OFF' + button += ' A ON/OFF' elif bits[7][0] == '0' and bits[11][0] == '0': - button = button + ' B ON/OFF' + button += ' B ON/OFF' elif bits[9][0] == '0' and bits[11][0] == '0': - button = button + ' C ON/OFF' + button += ' C ON/OFF' elif bits[8][0] == '0' and bits[11][0] == '0': - button = button + ' D ON/OFF' + button += ' D ON/OFF' else: - button = button + ' Unknown' + button += ' Unknown' return ['%s' % address, bits[0][1], bits[5][2], \ '%s' % button, bits[6][1], bits[11][2]] |