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

minimal fixes in the owntracks mqtt device tracker #9866

Merged
merged 2 commits into from Oct 14, 2017
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 homeassistant/components/device_tracker/owntracks.py
Expand Up @@ -75,6 +75,7 @@ def async_handle_mqtt_message(topic, payload, qos):
except ValueError:
# If invalid JSON
_LOGGER.error("Unable to parse payload as JSON: %s", payload)
return

message['topic'] = topic

Expand All @@ -91,7 +92,11 @@ def _parse_topic(topic):

Async friendly.
"""
_, user, device, *_ = topic.split('/', 3)
try:
_, user, device, *_ = topic.split('/', 3)
except ValueError:
_LOGGER.error("Can't parse topic: '%s'", topic)
raise

return user, device

Expand Down