-
Notifications
You must be signed in to change notification settings - Fork 2
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
7 changed files
with
88 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
from gridbox_connector import GridboxConnector | ||
from viessmann_gridbox_connector import GridboxConnector | ||
from importlib.resources import path | ||
import json | ||
|
||
with open('config.json', 'r') as file: | ||
data = json.load(file) | ||
connector = GridboxConnector(data) | ||
# Retrieve live data | ||
live_data = connector.retrieve_live_data() | ||
print(live_data) | ||
with path('viessmann_gridbox_connector', 'config.json') as config_file: | ||
with open(config_file, 'r') as file: | ||
data = json.load(file) | ||
data["login"]["username"] = "username" | ||
data["login"]["password"] = "password" | ||
connector = GridboxConnector(data) | ||
# Retrieve live data | ||
live_data = connector.retrieve_live_data() | ||
print(live_data) |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import argparse | ||
from viessmann_gridbox_connector import GridboxConnector | ||
from importlib.resources import path | ||
import json | ||
|
||
def retrieve_live_data(username, password): | ||
with path('viessmann_gridbox_connector', 'config.json') as config_file: | ||
with open(config_file, 'r') as file: | ||
data = json.load(file) | ||
data["login"]["username"] = username | ||
data["login"]["password"] = password | ||
connector = GridboxConnector(data) | ||
# Retrieve live data | ||
live_data = connector.retrieve_live_data() | ||
return live_data | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Retrieve live data from Viessmann Gridbox.') | ||
parser.add_argument('-u', '--username', required=True, help='The username to use.') | ||
parser.add_argument('-p', '--password', required=True, help='The password to use.') | ||
args = parser.parse_args() | ||
|
||
live_data = retrieve_live_data(args.username, args.password) | ||
print(live_data) | ||
|
||
if __name__ == '__main__': | ||
main() |
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 |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
}, | ||
"login": { | ||
"grant_type": "http://auth0.com/oauth/grant-type/password-realm", | ||
"username": "[email protected]", | ||
"password": "Simon1991!", | ||
"username": "username", | ||
"password": "password!", | ||
"audience": "my.gridx", | ||
"client_id": "oZpr934Ikn8OZOHTJEcrgXkjio0I0Q7b", | ||
"scope": "email openid", | ||
|