Skip to content

Commit

Permalink
Cleanup pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
uzlonewolf committed May 26, 2024
1 parent c1f6e07 commit dd39363
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tinytuya/BulbDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@ def _hexvalue_to_hsv(hexvalue, bulb="A"):
h = int(hexvalue[7:10], 16) / 360.0
s = int(hexvalue[10:12], 16) / 255.0
v = int(hexvalue[12:14], 16) / 255.0
if bulb == "B":
elif bulb == "B":
# hexvalue is in hsv
h = int(hexvalue[0:4], 16) / 360.0
s = int(hexvalue[4:8], 16) / 1000.0
v = int(hexvalue[8:12], 16) / 1000.0
else:
# should we raise an error instead?
h = s = v = 0

return (h, s, v)

Expand Down
6 changes: 2 additions & 4 deletions tinytuya/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@

args = parser.parse_args()

print(args)

if args.debug:
print(args)
set_debug(True)

if args.command:
if args.debug2 and not args.debug:
print(args)
set_debug(True)

if args.device_file:
Expand All @@ -95,8 +95,6 @@
scanner.SNAPSHOTFILE = args.snapshot_file
wizard.SNAPSHOTFILE = args.snapshot_file

#dsfsadgfadsgdfg()

if args.command == 'scan':
scanner.scan( scantime=args.max_time, color=(not args.nocolor), forcescan=args.force, discover=(not args.no_broadcasts), assume_yes=args.yes )
elif args.command == 'snapshot':
Expand Down
1 change: 1 addition & 0 deletions tinytuya/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ def tuyaLookup(deviceid):
log.debug("Listening for Tuya devices on UDP ports %d, %d and %d", UDPPORT, UDPPORTS, UDPPORTAPP)
start_time = time.time()
timeout_time = time.time() + 5
scan_ips = None
current_ip = None
need_sleep = 0.1
user_break_count = 0
Expand Down

0 comments on commit dd39363

Please sign in to comment.