Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small tweaks to simplify #291

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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