Skip to content

Commit

Permalink
fix(#14) Add missing operational status for other heat pumps
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Jan 2, 2023
1 parent 094561a commit 65d32fc
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 63 deletions.
8 changes: 3 additions & 5 deletions ThermiaOnlineAPI/api/ThermiaAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from requests import cookies
import json
import hashlib
from typing import Dict, Union
from typing import Dict, Optional

from ThermiaOnlineAPI.const import (
REG_GROUP_HOT_WATER,
Expand Down Expand Up @@ -295,9 +295,7 @@ def __get_switch_register_index_and_value_from_group_by_register_name(
"registerValue": int(register_value),
}

def get_group_hot_water(
self, device: ThermiaHeatPump
) -> Dict[str, Union[int, None]]:
def get_group_hot_water(self, device: ThermiaHeatPump) -> Dict[str, Optional[int]]:
register_data: list = self.__get_register_group(device.id, REG_GROUP_HOT_WATER)

hot_water_switch_data = (
Expand Down Expand Up @@ -462,7 +460,7 @@ def __fetch_configuration(self):

return request.json()

def __authenticate_refresh_token(self) -> Union[str, None]:
def __authenticate_refresh_token(self) -> Optional[str]:
request_token__data = {
"client_id": THERMIA_AZURE_AUTH_CLIENT_ID_AND_SCOPE,
"redirect_uri": THERMIA_AZURE_AUTH_REDIRECT_URI,
Expand Down
9 changes: 8 additions & 1 deletion ThermiaOnlineAPI/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@
# Operational status registers
###############################################################################

REG_OPERATIONAL_STATUS_PRIO1 = "REG_OPERATIONAL_STATUS_PRIO1"
REG_OPERATIONAL_STATUS_PRIO1 = (
"REG_OPERATIONAL_STATUS_PRIO1" # Operational status for most heat pumps
)
COMP_STATUS_ITEC = "COMP_STATUS_ITEC" # Operational status for ITEC heat pumps
REG_OPERATIONAL_STATUS_PRIORITY_BITMASK = (
"REG_OPERATIONAL_STATUS_PRIORITY_BITMASK" # Operational status for Atlas heat pumps
)
REG_INTEGRAL_LSD = "REG_INTEGRAL_LSD"
REG_PID = "REG_PID"

###############################################################################
# Hot water registers
Expand Down
Loading

0 comments on commit 65d32fc

Please sign in to comment.