I am running a standard loop to check status and call arm/disarm functions. This has worked perfectly but I noticed that recently it started failing. This could have started after the last update downloaded but I am not sure. I don't know how to fix this. My code has been running for almost a year without any issues. Ideas?
code snippet:
try:
# Retrieved an AD2 device that has been exposed with ser2sock on localhost:10000
# and set up SSL values.
ssl_device = SocketDevice(interface=(SER2SOCK_HOST,SER2SOCK_PORT))
ssl_device.ssl = True
ssl_device.ssl_ca = SSL_CA
ssl_device.ssl_key = SSL_KEY
ssl_device.ssl_certificate = SSL_CERT
device = AlarmDecoder(ssl_device)
device.on_message += handle_message
device.on_arm += handle_arm
device.on_disarm += handle_disarm
print 'Running...'
with device.open():
while True:
time.sleep(1)
except Exception, ex:
print 'Exception:', ex
Log of the error message after I arm the alarm in Away mode:
[10010001000000003A--],002,[f70000008002001c08000000000000],"****DISARMED**** READY TO ARM "
[10010001000000003A--],002,[f70000008002001c08000000000000],"****DISARMED**** READY TO ARM "
{Arm alarm via key pad}
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/opt/alarmdecoder/alarmdecoder/devices.py", line 196, in run
self._device.read_line(timeout=self.READ_TIMEOUT)
File "/opt/alarmdecoder/alarmdecoder/devices.py", line 1219, in read_line
self.on_read(data=ret)
File "/opt/alarmdecoder/alarmdecoder/event/event.py", line 80, in fire
func(self.obj, *args, **kwargs)
File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 724, in _on_read
self._handle_message(data)
File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 371, in _handle_message
msg = self._handle_keypad_message(data)
File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 408, in _handle_keypad_message
self._update_internal_states(msg)
File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 541, in _update_internal_states
self._update_armed_status(message)
File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 621, in _update_armed_status
self.on_arm(stay=message.armed_home)
File "/opt/alarmdecoder/alarmdecoder/event/event.py", line 80, in fire
func(self.obj, *args, **kwargs)
TypeError: handle_arm() got an unexpected keyword argument 'stay'