Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for poorly formed RSSI causing thread to crash #21

Merged
merged 1 commit into from Dec 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/interfacers/EmonHubJeeInterfacer.py
Expand Up @@ -124,7 +124,12 @@ def read(self):

# Extract RSSI value if it's available
if str(f[-1])[0]=='(' and str(f[-1])[-1]==')':
c.rssi = int(f[-1][1:-1])
r = f[-1][1:-1]
try:
c.rssi = int(r)
except ValueError:
self._log.warning("Packet discarded as the RSSI format is invalid: "+ str(f))
return
f = f[:-1]

try:
Expand Down