diff --git a/tinytuya/Contrib/IRRemoteControlDevice.py b/tinytuya/Contrib/IRRemoteControlDevice.py index 956e7697..12a27d2f 100644 --- a/tinytuya/Contrib/IRRemoteControlDevice.py +++ b/tinytuya/Contrib/IRRemoteControlDevice.py @@ -115,7 +115,6 @@ import logging import struct import time -from math import ceil, floor from ..core import Device, log, CONTROL @@ -461,7 +460,7 @@ def head_key_to_pulses( head, key ): data += '0' else: # if the first byte is 0, the next byte is how many bits to transmit - byts = ceil( bits / 8 ) + byts = int( (bits + 7) / 8 ) cnt = byts * 2 data = key[:cnt] diff --git a/tinytuya/core.py b/tinytuya/core.py index 103d50ef..93fa840d 100644 --- a/tinytuya/core.py +++ b/tinytuya/core.py @@ -1728,13 +1728,6 @@ def decrypt_udp(msg): return payload return decrypt(msg, udpkey) -# Return positive number or zero -def floor(x): - if x > 0: - return x - else: - return 0 - def appenddevice(newdevice, devices): if newdevice["ip"] in devices: