Browse Source

Correctly decoding byte string. Added future requirement.

pyserial_fix
Scott Petersen 9 years ago
parent
commit
b22e7c3d28
3 changed files with 4 additions and 4 deletions
  1. +1
    -3
      alarmdecoder/decoder.py
  2. +1
    -0
      requirements.txt
  3. +2
    -1
      setup.py

+ 1
- 3
alarmdecoder/decoder.py View File

@@ -303,7 +303,7 @@ class AlarmDecoder(object):
:returns: :py:class:`~alarmdecoder.messages.Message`
"""

data = str(data)
data = data.decode('utf-8')

if data is not None:
data = data.lstrip('\0')
@@ -314,8 +314,6 @@ class AlarmDecoder(object):
msg = None
header = data[0:4]

#print('header', header, type(header), type(header[0]))

if header[0] != '!' or header == '!KPM':
msg = self._handle_keypad_message(data)



+ 1
- 0
requirements.txt View File

@@ -1 +1,2 @@
future==0.14.3
pyserial==2.7

+ 2
- 1
setup.py View File

@@ -30,7 +30,8 @@ setup(name='alarmdecoder',
license='MIT',
packages=['alarmdecoder', 'alarmdecoder.event'],
install_requires=[
'pyserial>=2.7',
'future==0.14.3'
'pyserial==2.7',
],
test_suite='nose.collector',
tests_require=['nose', 'mock'],


Loading…
Cancel
Save