From 259672c7d29bb8f4b43a7f1c8bb16ae88099190d Mon Sep 17 00:00:00 2001 From: Wayne Love Date: Sat, 13 Feb 2021 16:57:11 +1100 Subject: [PATCH] Fix il-formatted print statements --- broadlink_ac_mqtt/AcToMqtt.py | 2 +- broadlink_ac_mqtt/classes/broadlink/ac_db.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/broadlink_ac_mqtt/AcToMqtt.py b/broadlink_ac_mqtt/AcToMqtt.py index 985d089..5b36c57 100644 --- a/broadlink_ac_mqtt/AcToMqtt.py +++ b/broadlink_ac_mqtt/AcToMqtt.py @@ -39,7 +39,7 @@ def test(self,config): device_bla = broadlink.gendevice(devtype=0xFFFFFFF, host=(device['ip'],device['port']),mac = bytearray.fromhex(device['mac']), name=device['name']) status = device_bla.set_temperature(32) - print status + #print status def discover(self): diff --git a/broadlink_ac_mqtt/classes/broadlink/ac_db.py b/broadlink_ac_mqtt/classes/broadlink/ac_db.py index d2e3b40..b633fd0 100644 --- a/broadlink_ac_mqtt/classes/broadlink/ac_db.py +++ b/broadlink_ac_mqtt/classes/broadlink/ac_db.py @@ -998,7 +998,7 @@ def set_ac_status(self): self.logger.debug("Start set_ac_status") #packet = bytearray(32) #10111011 00000000 00000110 10000000 00000000 00000000 00001111 00000000 00000001 9 00000001 10 01000111 11 00101000 12 00100000 13 10100000 14 00000000 15 00100000 16 00000000 17 00000000 18 00100000 19 00000000 20 00010000 21 00000000 22 00000101 10010001 10010101 - print "setting something" + #print "setting something" if self.status['temp'] < 16: temperature = 16-8 temperature_05 = 0 @@ -1020,7 +1020,7 @@ def set_ac_status(self): else: temperature_05 = 1 temperature = int(self.status['temp'] -8) - print temperature + #print temperature payload = bytearray(23) payload[0] = 0xbb @@ -1147,7 +1147,7 @@ def send_packet(self, command, payload): packet[0x20] = checksum & 0xff packet[0x21] = checksum >> 8 - print 'Sending Packet:\n'+''.join(format(x, '02x') for x in packet)+"\n" + #print 'Sending Packet:\n'+''.join(format(x, '02x') for x in packet)+"\n" starttime = time.time() with self.lock: @@ -1156,12 +1156,12 @@ def send_packet(self, command, payload): self.cs.sendto(packet, self.host) self.cs.settimeout(1) response = self.cs.recvfrom(1024) - print response + #print response break except socket.timeout: if (time.time() - starttime) < self.timeout: pass - print "timedout" + #print "timedout" raise ConnectTimeout(200,self.host) return bytearray(response[0])