diff --git a/fw_downloads.py b/fw_downloads.py index 48a2120..fff63e1 100755 --- a/fw_downloads.py +++ b/fw_downloads.py @@ -15,13 +15,20 @@ parser = argparse.ArgumentParser( prog = 'fw_downloads.py', description = 'Downloads zigbee firmware update files from various sources for the Deconz OTA plugin') parser.add_argument('-v', '--verbose', action='store_true', help='write each file operation to the console') +parser.add_argument('targets', help='Only download from the given targets. If none are specified, all will be tried', nargs='*', choices=['danfoss', 'ikea', 'lightify', 'koenkk']) args = parser.parse_args() print ('%s - Downloadscript started' % f"{datetime.datetime.now():%Y-%m-%d %H:%M:%S}") -Danfoss(args.verbose).perform_downloads() -Ikea(args.verbose).perform_downloads() -GithubKoenkk(args.verbose).perform_downloads() -Lightify(args.verbose).perform_downloads() +fetch_all = not args.targets + +if fetch_all or 'koenkk' in args.targets: + GithubKoenkk(args.verbose).perform_downloads() +if fetch_all or 'ikea' in args.targets: + Ikea(args.verbose).perform_downloads() +if fetch_all or 'lightify' in args.targets: + Lightify(args.verbose).perform_downloads() +if fetch_all or 'danfoss' in args.targets: + Danfoss(args.verbose).perform_downloads() print ('%s - Downloadscript finished' % f"{datetime.datetime.now():%Y-%m-%d %H:%M:%S}")