-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import sys | ||
import logging | ||
from PyViCare.PyViCare import PyViCare | ||
from functools import wraps | ||
from typing import Callable | ||
from PyViCare import Feature | ||
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError | ||
import json | ||
#from myUtils import HandleNotSupported | ||
|
||
client_id = "" | ||
email = "" | ||
password = "" | ||
file = "./tests/features.json" | ||
|
||
vicare = PyViCare() | ||
vicare.initWithCredentials(email, password, client_id, "token.save") | ||
|
||
device = vicare.devices[1] | ||
print(json.dumps(device.service.fetch_all_features())) | ||
|
||
fJson = json.dumps( | ||
device.service.fetch_all_features(), | ||
indent=4, | ||
) | ||
with open(file, mode="w", encoding="utf-8") as f: | ||
f.write(fJson) | ||
print("Features have been written to %s", file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters