Skip to content

Commit

Permalink
Allow a string as the force-scan list
Browse files Browse the repository at this point in the history
  • Loading branch information
uzlonewolf committed Jun 23, 2024
1 parent d3be0ac commit d3bc3d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tinytuya/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,9 +1129,10 @@ def tuyaLookup(deviceid):
if verbose:
print(term.subbold + " Option: " + term.dim + "Network force scanning requested.\n")

# argparse gives us a list of lists
# the inner list is empty [[]] when no address specified
add_connected = True
if isinstance( forcescan, list ) or isinstance( forcescan, tuple ):
# argparse gives us a list of lists [[]] when no address specified
for ip in forcescan:
if isinstance( ip, list ) or isinstance( ip, tuple ):
for ip2 in ip:
Expand All @@ -1141,6 +1142,10 @@ def tuyaLookup(deviceid):
networks.append( ip )
add_connected = False

if isinstance( forcescan, str ) or isinstance( forcescan, bytes ):
networks.append( forcescan )
add_connected = False

if add_connected:
if not NETIFLIBS:
print(term.alert +
Expand Down

0 comments on commit d3bc3d0

Please sign in to comment.