Skip to content

Commit 2ba9384

Browse files
committed
Fix network calls, data return types
1 parent 5725a55 commit 2ba9384

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

ThermiaOnlineAPI/api/ThermiaAPI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(self, email, password, api_type):
6161
}
6262

6363
self.__session = requests.Session()
64-
retry = Retry(connect=3, backoff_factor=0.5)
64+
retry = Retry(total=20, connect=10, backoff_factor=0.1)
6565
adapter = HTTPAdapter(max_retries=retry)
6666
self.__session.mount("https://", adapter)
6767

ThermiaOnlineAPI/model/HeatPump.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,9 @@ def operational_status(self) -> Optional[Union[str, List[str]]]:
595595
name for value, name in data_items_list if value == current_register_value
596596
]
597597

598+
if len(current_operation_mode) == 0:
599+
return None
600+
598601
if (
599602
len(current_operation_mode) != 1
600603
and current_register_value > 0
@@ -626,12 +629,12 @@ def available_operational_statuses(self) -> Optional[List[str]]:
626629
data = self.__get_all_operational_statuses_from_operational_status()
627630

628631
if data is None:
629-
return None
632+
return []
630633

631634
return list(data.values())
632635

633636
@property
634-
def available_operational_statuses_map(self):
637+
def available_operational_statuses_map(self) -> Optional[ChainMap]:
635638
return self.__get_all_operational_statuses_from_operational_status()
636639

637640
@property

0 commit comments

Comments
 (0)