MisterWil / abodepy

A thin Python wrapper for the Abode alarm API
MIT License
49 stars 17 forks source link

lomond issues with Python 3.7 #37

Closed shred86 closed 5 years ago

shred86 commented 5 years ago

If you try to use abodepy with Python 3.7, it breaks the lomond web listener. Here's the error in Home Assistant:

Traceback (most recent call last):
  File "/Users/shred/venv/homeassistant/lib/python3.7/site-packages/lomond/session.py", line 414, in run
    for event in self.websocket.feed(data):
  File "/Users/shred/venv/homeassistant/lib/python3.7/site-packages/lomond/websocket.py", line 263, in feed
    for message in self.stream.feed(data):
RuntimeError: generator raised StopIteration
2018-09-09 10:02:06 INFO (SocketIOThread) [abodepy.socketio] Websocket Disconnected
^C2018-09-09 10:02:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_stop[L]>
2018-09-09 10:02:07 INFO (SyncWorker_6) [abodepy.socketio] Stopping SocketIO thread...
2018-09-09 10:02:07 DEBUG (SyncWorker_6) [abodepy] Logout Response: {"code":200,"message":"Logout successful."}
2018-09-09 10:02:07 INFO (SyncWorker_6) [abodepy] Logout successful
2018-09-09 10:02:07 INFO (SyncWorker_6) [homeassistant.components.abode] Logged out of Abode
2018-09-09 10:02:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_close[L]>

Works fine with Python 3.6.5.

shred86 commented 5 years ago

This was fixed in lomond 0.3.1. Abodepy is currently using 0.1.14. I suppose we just need to test Abodepy with a version 0.3.1 or greater and update the requirements.

I'm running the latest version of lomond 0.3.2 with abodepy and it fixes the issue.

Pull request created.

shred86 commented 5 years ago

Fixed in Abodepy 0.14.0.