Skip to content

Commit c334b74

Browse files
authored
Merge pull request #291 from gstein/tweaks
small tweaks to simplify
2 parents 662e7d2 + 85b9545 commit c334b74

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

tinytuya/Contrib/IRRemoteControlDevice.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
import logging
116116
import struct
117117
import time
118-
from math import ceil, floor
119118

120119
from ..core import Device, log, CONTROL
121120

@@ -461,7 +460,7 @@ def head_key_to_pulses( head, key ):
461460
data += '0'
462461
else:
463462
# if the first byte is 0, the next byte is how many bits to transmit
464-
byts = ceil( bits / 8 )
463+
byts = int( (bits + 7) / 8 )
465464
cnt = byts * 2
466465
data = key[:cnt]
467466

tinytuya/core.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,13 +1728,6 @@ def decrypt_udp(msg):
17281728
return payload
17291729
return decrypt(msg, udpkey)
17301730

1731-
# Return positive number or zero
1732-
def floor(x):
1733-
if x > 0:
1734-
return x
1735-
else:
1736-
return 0
1737-
17381731

17391732
def appenddevice(newdevice, devices):
17401733
if newdevice["ip"] in devices:

0 commit comments

Comments
 (0)