allow to send commands to gateway
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user