Skip to content

Commit

Permalink
Move example file credentials to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Dec 26, 2022
1 parent 53b367a commit 6a69a71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Thus, I have created a `debug()` function that runs when `example.py` is execute
* `genesis`, online access url is https://online-genesis.thermia.se

## How to use api:
See [example.py](https://github.com/klejejs/python-thermia-online-api/blob/main/example.py) file
See [example.py](https://github.com/klejejs/python-thermia-online-api/blob/main/example.py) file for examples.

To execute the example file, first run `pip install -r requirements.txt` to install the required dependencies, then run `python3 example.py` to execute the example file. You will be prompted to enter your username and password, and then the example file will run. If do not want to manually enter your credentials every time, you can edit the `credentials.py` file and add your credentials there.

## Available functions in Thermia class:
| Function | Description |
Expand Down
2 changes: 2 additions & 0 deletions credentials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
USERNAME = ""
PASSWORD = ""
8 changes: 5 additions & 3 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from datetime import datetime, timedelta
from ThermiaOnlineAPI import Thermia
from credentials import USERNAME, PASSWORD

USERNAME = "demo"
PASSWORD = "demo"
CHANGE_HEAT_PUMP_DATA_DURING_TEST = False # Set to True if you want to change heat pump data during test

CHANGE_HEAT_PUMP_DATA_DURING_TEST = True
if not USERNAME or not PASSWORD:
USERNAME = input("Enter username: ")
PASSWORD = input("Enter password: ")

thermia = Thermia(USERNAME, PASSWORD, "classic")

Expand Down

0 comments on commit 6a69a71

Please sign in to comment.