File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11USERNAME = ""
22PASSWORD = ""
3+ API_TYPE = "" # classic or genesis
Original file line number Diff line number Diff line change 11from datetime import datetime , timedelta
22from ThermiaOnlineAPI import Thermia
3- from credentials import USERNAME , PASSWORD
3+ from credentials import USERNAME , PASSWORD , API_TYPE
4+ from ThermiaOnlineAPI .const import (
5+ THERMIA_API_TYPE_CLASSIC ,
6+ THERMIA_API_TYPE_GENESIS ,
7+ )
48
59CHANGE_HEAT_PUMP_DATA_DURING_TEST = (
610 False # Set to True if you want to change heat pump data during test
1014 USERNAME = input ("Enter username: " )
1115 PASSWORD = input ("Enter password: " )
1216
13- thermia = Thermia (USERNAME , PASSWORD , "classic" )
17+ if not API_TYPE :
18+ api_type_number = input ("Enter api type (1 = classic, 2 = genesis): " )
19+ if api_type_number == "1" :
20+ API_TYPE = THERMIA_API_TYPE_CLASSIC
21+ elif api_type_number == "2" :
22+ API_TYPE = THERMIA_API_TYPE_GENESIS
23+ else :
24+ print ("Invalid api type" )
25+ exit (1 )
26+
27+ thermia = Thermia (USERNAME , PASSWORD , api_type = API_TYPE )
1428
1529print ("Connected: " + str (thermia .connected ))
1630
You can’t perform that action at this time.
0 commit comments