Skip to content

Commit

Permalink
Large-scale refactor of scan function
Browse files Browse the repository at this point in the history
- Returns a list of the discovered devices for use as a utility
  function.
- Ability to silence output for use as a utility.
- Improve performance of multi-threaded scan by using a Queue.
- Switch to "f" strings for interactive output.
- General code flow improvements and encapsulation.
  • Loading branch information
Nexarian committed Dec 1, 2024
1 parent 5e5bf05 commit 875821b
Show file tree
Hide file tree
Showing 2 changed files with 240 additions and 155 deletions.
12 changes: 7 additions & 5 deletions pypowerwall/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@
from pypowerwall import scan

print("pyPowerwall [%s] - Scanner\n" % version)
color = not args.nocolor
ip = args.ip
hosts = args.hosts
timeout = args.timeout
scan.scan(color, timeout, hosts, ip)
scan.scan(
ip=args.ip,
max_threads=args.hosts,
timeout=args.timeout,
color=not args.nocolor,
interactive=True
)

# Set Powerwall Mode
elif command == 'set':
Expand Down
Loading

0 comments on commit 875821b

Please sign in to comment.