Skip to content

Commit

Permalink
Merge pull request #291 from gstein/tweaks
Browse files Browse the repository at this point in the history
small tweaks to simplify
  • Loading branch information
jasonacox authored Mar 2, 2023
2 parents 662e7d2 + 85b9545 commit c334b74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions tinytuya/Contrib/IRRemoteControlDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
import logging
import struct
import time
from math import ceil, floor

from ..core import Device, log, CONTROL

Expand Down Expand Up @@ -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]

Expand Down
7 changes: 0 additions & 7 deletions tinytuya/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c334b74

Please sign in to comment.