Do not print on stdout, use arg and write file instead
This ensures we don't put errors inside devices.json file.
This commit is contained in:
@@ -38,6 +38,7 @@ def debug(*args):
|
|||||||
|
|
||||||
email = sys.argv[1]
|
email = sys.argv[1]
|
||||||
password = sys.argv[2]
|
password = sys.argv[2]
|
||||||
|
devicefile = sys.argv[3]
|
||||||
|
|
||||||
headers = {"User-Agent": "hc-login/1.0"}
|
headers = {"User-Agent": "hc-login/1.0"}
|
||||||
|
|
||||||
@@ -313,4 +314,5 @@ for app in account["data"]["homeAppliances"]:
|
|||||||
config["description"] = machine["description"]
|
config["description"] = machine["description"]
|
||||||
config["features"] = augment_device_features(machine["features"])
|
config["features"] = augment_device_features(machine["features"])
|
||||||
|
|
||||||
print(json.dumps(configs, indent=4))
|
with open(devicefile, 'w') as f:
|
||||||
|
json.dump(configs, f, ensure_ascii=True, indent=4)
|
||||||
|
|||||||
Reference in New Issue
Block a user