allow to send commands to gateway

This commit is contained in:
2017-04-01 22:52:49 +03:00
parent 86d6db496a
commit 74adba1a68
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ if __name__ == "__main__":
client = mqtt.Mqtt(config)
client.connect()
#only this devices can be controlled from MQTT
client.subscribe("gateway", "+", "rgb", "set")
client.subscribe("gateway", "+", "+", "set")
client.subscribe("plug", "+", "status", "set")
gateway = XiaomiHub(gateway_pass)
+1
View File
@@ -128,6 +128,7 @@ class XiaomiHub:
def _send_socket(self, cmd, rtnCmd, ip, port):
socket = self._socket
try:
_LOGGER.info('Sending to GW {0}'.format(cmd))
self._read_unwanted_data()
socket.settimeout(30.0)