Skip to content

Commit

Permalink
~ commenting changes, fixed whitespace pylint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nohum committed Aug 20, 2017
1 parent c697b68 commit bb55a47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion handler/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self):
def on_mqtt_connected(self, client):
self.logger.debug("mqtt connected callback has been invoked")
self.mqtt_client = client
# insert + as identifier so that every command to every identifier (= ip address) will be recognized
# insert + as identifier so that every command to every identifier (= friendly names) will be recognized
self.mqtt_client.subscribe(TOPIC_COMMAND_VOLUME_LEVEL % "+")
self.mqtt_client.subscribe(TOPIC_COMMAND_VOLUME_MUTED % "+")
self.mqtt_client.subscribe(TOPIC_COMMAND_PLAYER_POSITION % "+")
Expand Down
2 changes: 1 addition & 1 deletion handler/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, mqtt_connection, mqtt_topic_filter, changes_callback):

def is_topic_filter_matching(self, topic):
"""
Check if a topic (e.g.: chromecast/192.168.0.1/player_state) matches our filter (the ip address part).
Check if a topic (e.g.: chromecast/my_device_name/player_state) matches our filter (the name part).
"""
try:
return topic.split("/")[1] == self.topic_filter
Expand Down
2 changes: 2 additions & 0 deletions helper/mqtt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from paho.mqtt.client import Client, MQTT_ERR_NO_CONN, MQTT_ERR_SUCCESS
import logging


class MqttConnectionCallback:

def on_mqtt_connected(self, client):
Expand All @@ -9,6 +10,7 @@ def on_mqtt_connected(self, client):
def on_mqtt_message_received(self, topic, payload):
pass


class MqttConnection:

def __init__(self, ip, port, username, password, connection_callback):
Expand Down

0 comments on commit bb55a47

Please sign in to comment.