electrolux-group-developer-sdk 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/PKG-INFO +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/config.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/cr_config.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/dw_config.py +2 -2
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/hb_config.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/ov_config.py +3 -3
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/rvc_config.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/so_config.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/td_config.py +2 -2
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/wd_config.py +2 -2
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/wm_config.py +2 -2
- electrolux_group_developer_sdk-0.1.3/electrolux_group_developer_sdk/auth/auth_data.py +5 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/auth/token_manager.py +7 -6
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliance_client.py +12 -12
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/ac_appliance.py +5 -5
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/ap_appliance.py +3 -3
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/cr_appliance.py +4 -4
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/dam_ac_appliance.py +4 -4
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/dh_appliance.py +4 -4
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/dw_appliance.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/hb_appliance.py +4 -4
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/hd_appliance.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/ov_appliance.py +11 -11
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/rvc_appliance.py +8 -8
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/so_appliance.py +31 -31
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/td_appliance.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/wd_appliance.py +6 -6
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/wm_appliance.py +6 -6
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/client_exception.py +4 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/appliance_details.py +2 -2
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/appliance_state.py +2 -2
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/failed_connection_exception.py +4 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/constants.py +1 -1
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/pyproject.toml +1 -1
- electrolux_group_developer_sdk-0.1.2/electrolux_group_developer_sdk/auth/auth_data.py +0 -5
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/LICENSE +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/README.md +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/__init__.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/__init__.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/ac_config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/ap_config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/dam_ac_config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/dh_config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/appliance_config/hd_config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/auth/__init__.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/auth/invalid_credentials_exception.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/auth/invalid_token_exception.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/cli_test.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/__init__.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliance_data_factory.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/__init__.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/appliances/appliance_data.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/client_util.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/__init__.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/appliance.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/interactive_map.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/livestream_config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/dto/memory_map.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/client/rate_limiter.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/config.py +0 -0
- {electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/electrolux_group_developer_sdk/feature_constants.py +0 -0
|
@@ -13,7 +13,7 @@ class ApplianceConfig(BaseModel):
|
|
|
13
13
|
"""Return the state given a specific key."""
|
|
14
14
|
return reported_appliance_state.get(key) if (key := self.get_property(state_key)) else None
|
|
15
15
|
|
|
16
|
-
def is_capability_supported(self, feature):
|
|
16
|
+
def is_capability_supported(self, feature: str | list[str]):
|
|
17
17
|
"""Return True if the appliance supports this capability or any capability in a list."""
|
|
18
18
|
if isinstance(feature, str):
|
|
19
19
|
key = self.get_property(feature)
|
|
@@ -45,7 +45,7 @@ class CrConfig(ApplianceConfig):
|
|
|
45
45
|
|
|
46
46
|
return outer_value.get(nested_state_key)
|
|
47
47
|
|
|
48
|
-
def is_cavity_capability_supported(self, cavity: str, feature) -> bool:
|
|
48
|
+
def is_cavity_capability_supported(self, cavity: str, feature: str | list[str]) -> bool:
|
|
49
49
|
"""Return True if the appliance supports this cavity capability or any capability in a list."""
|
|
50
50
|
cavity_capabilities = self.capabilities.get(cavity)
|
|
51
51
|
if cavity_capabilities is None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Dishwasher configuration."""
|
|
2
2
|
import datetime
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Optional
|
|
4
4
|
from zoneinfo import ZoneInfo
|
|
5
5
|
|
|
6
6
|
from .config import ApplianceConfig
|
|
@@ -77,7 +77,7 @@ class DwConfig(ApplianceConfig):
|
|
|
77
77
|
"""Get the current alerts from the reported state."""
|
|
78
78
|
return self._get_state(ALERTS, reported_appliance_state)
|
|
79
79
|
|
|
80
|
-
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[datetime, datetime]:
|
|
80
|
+
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[Optional[datetime.datetime], Optional[datetime.datetime]]:
|
|
81
81
|
"""Get the current start at time and end at time from the reported state."""
|
|
82
82
|
appliance_state = self.get_current_appliance_state(reported_appliance_state)
|
|
83
83
|
|
|
@@ -49,7 +49,7 @@ class HbConfig(ApplianceConfig):
|
|
|
49
49
|
hood_capabilities = self.capabilities.get(self.get_property(HOB_HOOD), {})
|
|
50
50
|
return key is not None and hood_capabilities is not None and key in hood_capabilities
|
|
51
51
|
|
|
52
|
-
def is_hob_zone_capability_supported(self, zone:str, feature: str) -> bool:
|
|
52
|
+
def is_hob_zone_capability_supported(self, zone: str, feature: str) -> bool:
|
|
53
53
|
"""Return True if the appliance supports this hob zone capability."""
|
|
54
54
|
key = self.get_property(feature)
|
|
55
55
|
hob_zone_capabilities = self.capabilities.get(zone)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Oven configuration."""
|
|
2
2
|
import datetime
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Optional
|
|
4
4
|
from zoneinfo import ZoneInfo
|
|
5
5
|
|
|
6
6
|
from .config import ApplianceConfig
|
|
@@ -57,7 +57,7 @@ class OvConfig(ApplianceConfig):
|
|
|
57
57
|
if not meta.get("disabled", False)
|
|
58
58
|
]
|
|
59
59
|
|
|
60
|
-
def get_temperature_range(self, program_name: str, reported_appliance_state: dict) -> dict[str, float]:
|
|
60
|
+
def get_temperature_range(self, program_name: str, reported_appliance_state: dict[str, Any]) -> dict[str, float]:
|
|
61
61
|
"""Extract temperature range for the given program based on temperature unit."""
|
|
62
62
|
|
|
63
63
|
program_trigger = self.capabilities.get(self.get_property(PROGRAM), {}).get(VALUES, {}).get(program_name, {})
|
|
@@ -202,7 +202,7 @@ class OvConfig(ApplianceConfig):
|
|
|
202
202
|
"""Get the current display food probe temperature c from the reported state."""
|
|
203
203
|
return self._get_state(DISPLAY_FOOD_PROBE_TEMPERATURE_C, reported_appliance_state)
|
|
204
204
|
|
|
205
|
-
def get_current_start_at(self, reported_appliance_state: dict[str, Any]) -> datetime:
|
|
205
|
+
def get_current_start_at(self, reported_appliance_state: dict[str, Any]) -> Optional[datetime.datetime]:
|
|
206
206
|
"""Get the current start at time from the reported state."""
|
|
207
207
|
appliance_state = self.get_current_appliance_state(reported_appliance_state)
|
|
208
208
|
|
|
@@ -152,7 +152,7 @@ class RvcConfig(ApplianceConfig):
|
|
|
152
152
|
def _is_paused_map(self) -> dict[str, Any]:
|
|
153
153
|
return self.mapping.get(IS_PAUSED_MAP, {})
|
|
154
154
|
|
|
155
|
-
def get_supported_modes(self) -> list[
|
|
155
|
+
def get_supported_modes(self) -> list[int] | list[str]:
|
|
156
156
|
"""Return the list of supported readable modes."""
|
|
157
157
|
mode_capability = self.capabilities.get(self.get_property(MODE))
|
|
158
158
|
if not mode_capability:
|
|
@@ -62,7 +62,7 @@ class SoConfig(ApplianceConfig):
|
|
|
62
62
|
|
|
63
63
|
return outer_value.get(nested_state_key)
|
|
64
64
|
|
|
65
|
-
def is_cavity_capability_supported(self, cavity: str, feature) -> bool:
|
|
65
|
+
def is_cavity_capability_supported(self, cavity: str, feature: str | list[str]) -> bool:
|
|
66
66
|
"""Return True if the appliance supports this cavity capability or any capability in a list."""
|
|
67
67
|
cavity_capabilities = self.capabilities.get(cavity)
|
|
68
68
|
if cavity_capabilities is None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Tumble Dryer configuration."""
|
|
2
2
|
import datetime
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Optional
|
|
4
4
|
from zoneinfo import ZoneInfo
|
|
5
5
|
|
|
6
6
|
from .config import ApplianceConfig
|
|
@@ -81,7 +81,7 @@ class TdConfig(ApplianceConfig):
|
|
|
81
81
|
"""Get the current appliance state from the reported state."""
|
|
82
82
|
return self._get_state(APPLIANCE_STATE, reported_appliance_state)
|
|
83
83
|
|
|
84
|
-
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[datetime, datetime]:
|
|
84
|
+
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[Optional[datetime.datetime], Optional[datetime.datetime]]:
|
|
85
85
|
"""Get the current start at time and end at time from the reported state."""
|
|
86
86
|
appliance_state = self.get_current_appliance_state(reported_appliance_state)
|
|
87
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Washer Dryer configuration."""
|
|
2
2
|
import datetime
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Optional
|
|
4
4
|
from zoneinfo import ZoneInfo
|
|
5
5
|
|
|
6
6
|
from .config import ApplianceConfig
|
|
@@ -200,7 +200,7 @@ class WdConfig(ApplianceConfig):
|
|
|
200
200
|
self.get_property(TANK_B_RESERVE)
|
|
201
201
|
)
|
|
202
202
|
|
|
203
|
-
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[datetime, datetime]:
|
|
203
|
+
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[Optional[datetime.datetime], Optional[datetime.datetime]]:
|
|
204
204
|
"""Get the current start at time and end at time from the reported state."""
|
|
205
205
|
appliance_state = self.get_current_appliance_state(reported_appliance_state)
|
|
206
206
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Washer Machine configuration."""
|
|
2
2
|
import datetime
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Optional
|
|
4
4
|
from zoneinfo import ZoneInfo
|
|
5
5
|
|
|
6
6
|
from .config import ApplianceConfig
|
|
@@ -196,7 +196,7 @@ class WmConfig(ApplianceConfig):
|
|
|
196
196
|
self.get_property(TANK_B_RESERVE)
|
|
197
197
|
)
|
|
198
198
|
|
|
199
|
-
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[datetime, datetime]:
|
|
199
|
+
def get_current_start_at_stop_at(self, reported_appliance_state: dict[str, Any]) -> tuple[Optional[datetime.datetime], Optional[datetime.datetime]]:
|
|
200
200
|
"""Get the current start at time and end at time from the reported state."""
|
|
201
201
|
appliance_state = self.get_current_appliance_state(reported_appliance_state)
|
|
202
202
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import time
|
|
3
|
+
from typing import Callable, Optional
|
|
3
4
|
|
|
4
5
|
import jwt
|
|
5
6
|
|
|
@@ -13,7 +14,7 @@ from ..constants import REFRESH_TOKEN, POST
|
|
|
13
14
|
_LOGGER = logging.getLogger(__name__)
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
def get_user_id_from_token(token) -> str:
|
|
17
|
+
def get_user_id_from_token(token: str) -> str:
|
|
17
18
|
"""Extract user id from token"""
|
|
18
19
|
payload = jwt.decode(
|
|
19
20
|
token,
|
|
@@ -26,7 +27,7 @@ def get_user_id_from_token(token) -> str:
|
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
class TokenManager:
|
|
29
|
-
def __init__(self, access_token: str, refresh_token: str, api_key: str, on_token_update=None):
|
|
30
|
+
def __init__(self, access_token: str, refresh_token: str, api_key: str, on_token_update: Optional[Callable[[str, str, str], None]] = None):
|
|
30
31
|
"""Initialize the token manager."""
|
|
31
32
|
if access_token is None:
|
|
32
33
|
_LOGGER.error("Access Token is missing")
|
|
@@ -35,7 +36,7 @@ class TokenManager:
|
|
|
35
36
|
self._auth_data = AuthData(access_token, refresh_token, api_key)
|
|
36
37
|
self.update(access_token, refresh_token, api_key)
|
|
37
38
|
|
|
38
|
-
def update(self, access_token: str, refresh_token: str, api_key: str):
|
|
39
|
+
def update(self, access_token: str, refresh_token: str, api_key: str) -> None:
|
|
39
40
|
"""Update the authentication data."""
|
|
40
41
|
if self._on_token_update:
|
|
41
42
|
self._on_token_update(access_token, refresh_token, api_key)
|
|
@@ -75,7 +76,7 @@ class TokenManager:
|
|
|
75
76
|
_LOGGER.error("Access Token is invalid - %s", e)
|
|
76
77
|
return False
|
|
77
78
|
|
|
78
|
-
async def refresh_token(self):
|
|
79
|
+
async def refresh_token(self) -> bool:
|
|
79
80
|
auth_data = self._auth_data
|
|
80
81
|
|
|
81
82
|
if not auth_data or auth_data.refresh_token is None:
|
|
@@ -98,7 +99,7 @@ class TokenManager:
|
|
|
98
99
|
_LOGGER.error("Error during token refresh: %s", e)
|
|
99
100
|
return False
|
|
100
101
|
|
|
101
|
-
async def revoke_token(self):
|
|
102
|
+
async def revoke_token(self) -> bool:
|
|
102
103
|
auth_data = self._auth_data
|
|
103
104
|
if not auth_data or auth_data.refresh_token is None:
|
|
104
105
|
raise Exception("Missing refresh token")
|
|
@@ -115,7 +116,7 @@ class TokenManager:
|
|
|
115
116
|
_LOGGER.error("Error during token revoke: %s", e)
|
|
116
117
|
return False
|
|
117
118
|
|
|
118
|
-
async def get_auth_data(self):
|
|
119
|
+
async def get_auth_data(self) -> AuthData:
|
|
119
120
|
auth_data = self._auth_data
|
|
120
121
|
if not auth_data or auth_data.access_token is None or auth_data.api_key is None:
|
|
121
122
|
raise Exception("Missing access token or API key")
|
|
@@ -40,7 +40,7 @@ def _is_dam_appliance(appliance_id):
|
|
|
40
40
|
return False
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def _build_user_agent(external_user_agent: str = None) -> str:
|
|
43
|
+
def _build_user_agent(external_user_agent: Optional[str] = None) -> str:
|
|
44
44
|
sdk_version = SDK_VERSION
|
|
45
45
|
|
|
46
46
|
sdk_user_agent = f"{SDK_USER_AGENT}/{sdk_version}"
|
|
@@ -62,7 +62,7 @@ class ApplianceClient:
|
|
|
62
62
|
_token_manager (TokenManager)
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
|
-
def __init__(self, token_manager: TokenManager, external_user_agent: str = None):
|
|
65
|
+
def __init__(self, token_manager: TokenManager, external_user_agent: Optional[str] = None):
|
|
66
66
|
"""
|
|
67
67
|
Initialize the ApplianceClient.
|
|
68
68
|
|
|
@@ -77,7 +77,7 @@ class ApplianceClient:
|
|
|
77
77
|
self._sse_listeners: dict[str, list[Callable[[dict], None]]] = {}
|
|
78
78
|
self._external_user_agent = external_user_agent
|
|
79
79
|
|
|
80
|
-
async def test_connection(self):
|
|
80
|
+
async def test_connection(self) -> None:
|
|
81
81
|
try:
|
|
82
82
|
await self._send_authorized_request(GET, GET_APPLIANCES_URL)
|
|
83
83
|
except ApplianceClientException as e:
|
|
@@ -122,7 +122,7 @@ class ApplianceClient:
|
|
|
122
122
|
|
|
123
123
|
return appliance_list
|
|
124
124
|
|
|
125
|
-
async def get_appliances(self):
|
|
125
|
+
async def get_appliances(self) -> list[Appliance]:
|
|
126
126
|
"""
|
|
127
127
|
Retrieve a list of appliances associated with the authenticated user.
|
|
128
128
|
|
|
@@ -145,7 +145,7 @@ class ApplianceClient:
|
|
|
145
145
|
_LOGGER.error("Failed to get appliances: %s", e)
|
|
146
146
|
raise ApplianceClientException(f"Failed to get appliances: {e}")
|
|
147
147
|
|
|
148
|
-
async def get_appliance_details(self, appliance_id):
|
|
148
|
+
async def get_appliance_details(self, appliance_id: str) -> ApplianceDetails:
|
|
149
149
|
"""
|
|
150
150
|
Retrieve detailed information about a specific appliance.
|
|
151
151
|
|
|
@@ -176,7 +176,7 @@ class ApplianceClient:
|
|
|
176
176
|
_LOGGER.error("Error during get appliance info: %s", e)
|
|
177
177
|
raise ApplianceClientException(f"Failed to get appliance info: {e}")
|
|
178
178
|
|
|
179
|
-
async def get_appliance_state(self, appliance_id):
|
|
179
|
+
async def get_appliance_state(self, appliance_id: str) -> ApplianceState:
|
|
180
180
|
"""
|
|
181
181
|
Retrieve the current state of a specific appliance.
|
|
182
182
|
|
|
@@ -214,7 +214,7 @@ class ApplianceClient:
|
|
|
214
214
|
_LOGGER.error("Error during get appliance state: %s", e)
|
|
215
215
|
raise ApplianceClientException(f"Failed to get appliance state: {e}")
|
|
216
216
|
|
|
217
|
-
async def send_command(self, appliance_id: str, commands: dict[str, Any]):
|
|
217
|
+
async def send_command(self, appliance_id: str, commands: dict[str, Any]) -> Any:
|
|
218
218
|
"""
|
|
219
219
|
Send a command to the appliance.
|
|
220
220
|
|
|
@@ -248,7 +248,7 @@ class ApplianceClient:
|
|
|
248
248
|
_LOGGER.error("Error sending command: %s", e)
|
|
249
249
|
raise ApplianceClientException(f"Failed to send command: {e}")
|
|
250
250
|
|
|
251
|
-
async def get_interactive_maps(self, appliance_id):
|
|
251
|
+
async def get_interactive_maps(self, appliance_id: str) -> list[dict[str, Any]]:
|
|
252
252
|
"""
|
|
253
253
|
Retrieve interactive maps for a given appliance ID.
|
|
254
254
|
|
|
@@ -282,7 +282,7 @@ class ApplianceClient:
|
|
|
282
282
|
_LOGGER.error("Error during get interactive map: %s", e)
|
|
283
283
|
raise ApplianceClientException(f"Failed to get interactive maps: {e}")
|
|
284
284
|
|
|
285
|
-
async def get_memory_maps(self, appliance_id):
|
|
285
|
+
async def get_memory_maps(self, appliance_id: str) -> list[dict[str, Any]]:
|
|
286
286
|
"""
|
|
287
287
|
Retrieve memory maps for a given appliance ID.
|
|
288
288
|
|
|
@@ -316,7 +316,7 @@ class ApplianceClient:
|
|
|
316
316
|
_LOGGER.error("Error during get memory maps: %s", e)
|
|
317
317
|
raise ApplianceClientException(f"Failed to get memory maps: {e}")
|
|
318
318
|
|
|
319
|
-
async def get_livestream_config(self):
|
|
319
|
+
async def get_livestream_config(self) -> LivestreamConfig:
|
|
320
320
|
url = GET_LIVESTREAM_CONFIG_URL
|
|
321
321
|
try:
|
|
322
322
|
response = await self._send_authorized_request(GET, url)
|
|
@@ -415,13 +415,13 @@ class ApplianceClient:
|
|
|
415
415
|
_LOGGER.info("Close websession")
|
|
416
416
|
await websession.close()
|
|
417
417
|
|
|
418
|
-
def add_listener(self, appliance_id: str, callback: Callable[[dict], None]):
|
|
418
|
+
def add_listener(self, appliance_id: str, callback: Callable[[dict], None]) -> None:
|
|
419
419
|
"""Register a callback for a specific appliance."""
|
|
420
420
|
_LOGGER.info("Add listener for: %s", appliance_id)
|
|
421
421
|
|
|
422
422
|
self._sse_listeners.setdefault(appliance_id, []).append(callback)
|
|
423
423
|
|
|
424
|
-
def remove_listener(self, appliance_id: str, callback: Callable[[dict], None]):
|
|
424
|
+
def remove_listener(self, appliance_id: str, callback: Callable[[dict], None]) -> None:
|
|
425
425
|
"""Unregister a callback."""
|
|
426
426
|
_LOGGER.info("Remove listener for: %s", appliance_id)
|
|
427
427
|
|
|
@@ -21,7 +21,7 @@ class ACAppliance(ApplianceData):
|
|
|
21
21
|
capabilities = self.details.capabilities if self.details else {}
|
|
22
22
|
self._config = AcConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
23
23
|
|
|
24
|
-
def is_feature_supported(self, feature) -> bool:
|
|
24
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
25
25
|
return self._config.is_capability_supported(feature)
|
|
26
26
|
|
|
27
27
|
def get_supported_modes(self) -> list[str]:
|
|
@@ -76,25 +76,25 @@ class ACAppliance(ApplianceData):
|
|
|
76
76
|
"""Return the current fan speed setting."""
|
|
77
77
|
return self._config.get_current_fan_speed(self.state.properties.get(REPORTED))
|
|
78
78
|
|
|
79
|
-
def get_fan_speed_command(self, fan_speed) -> dict[str, Any]:
|
|
79
|
+
def get_fan_speed_command(self, fan_speed: str) -> dict[str, Any]:
|
|
80
80
|
"""Return the command payload to set the fan speed."""
|
|
81
81
|
return {
|
|
82
82
|
self._config.get_property(FAN_SPEED_SETTING): fan_speed
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
def get_mode_command(self, mode) -> dict[str, Any]:
|
|
85
|
+
def get_mode_command(self, mode: str) -> dict[str, Any]:
|
|
86
86
|
"""Return the command payload to set the mode."""
|
|
87
87
|
return {
|
|
88
88
|
self._config.get_property(MODE): mode
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
def get_temperature_c_command(self, temperature) -> dict[str, Any]:
|
|
91
|
+
def get_temperature_c_command(self, temperature: float) -> dict[str, Any]:
|
|
92
92
|
"""Return the command payload to set the temperature in Celsius."""
|
|
93
93
|
return {
|
|
94
94
|
self._config.get_property(TARGET_TEMPERATURE_C): temperature
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
def get_temperature_f_command(self, temperature) -> dict[str, Any]:
|
|
97
|
+
def get_temperature_f_command(self, temperature: float) -> dict[str, Any]:
|
|
98
98
|
"""Return the command payload to set the temperature in Fahrenheit."""
|
|
99
99
|
return {
|
|
100
100
|
self._config.get_property(TARGET_TEMPERATURE_F): temperature
|
|
@@ -21,7 +21,7 @@ class APAppliance(ApplianceData):
|
|
|
21
21
|
capabilities = self.details.capabilities if self.details else {}
|
|
22
22
|
self._config = ApConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
23
23
|
|
|
24
|
-
def is_feature_supported(self, feature) -> bool:
|
|
24
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
25
25
|
return self._config.is_capability_supported(feature)
|
|
26
26
|
|
|
27
27
|
def get_air_quality_map(self) -> dict[str, str]:
|
|
@@ -60,13 +60,13 @@ class APAppliance(ApplianceData):
|
|
|
60
60
|
"""Return the current air quality value for the specified property."""
|
|
61
61
|
return self._config.get_air_quality(self.state.properties.get(REPORTED), air_quality_property)
|
|
62
62
|
|
|
63
|
-
def get_fan_speed_command(self, fan_speed) -> dict[str,
|
|
63
|
+
def get_fan_speed_command(self, fan_speed: int) -> dict[str, Any]:
|
|
64
64
|
"""Return the command payload to set the fan speed."""
|
|
65
65
|
return {
|
|
66
66
|
self._config.get_property(FAN_SPEED): fan_speed
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
def get_mode_command(self, mode) -> dict[str,
|
|
69
|
+
def get_mode_command(self, mode: str) -> dict[str, Any]:
|
|
70
70
|
"""Return the command payload to set the mode."""
|
|
71
71
|
return {
|
|
72
72
|
self._config.get_property(WORKMODE): mode
|
|
@@ -21,7 +21,7 @@ class CRAppliance(ApplianceData):
|
|
|
21
21
|
capabilities = self.details.capabilities if self.details else {}
|
|
22
22
|
self._config = CrConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
23
23
|
|
|
24
|
-
def is_feature_supported(self, feature) -> bool:
|
|
24
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
25
25
|
return self._config.is_capability_supported(feature)
|
|
26
26
|
|
|
27
27
|
def is_cavity_feature_supported(self, cavity: str, feature: str) -> bool:
|
|
@@ -91,15 +91,15 @@ class CRAppliance(ApplianceData):
|
|
|
91
91
|
"""Get the current cavity door state from the reported state."""
|
|
92
92
|
return self._config.get_current_door_state(cavity, self.state.properties.get(REPORTED))
|
|
93
93
|
|
|
94
|
-
def get_set_cavity_temperature_f_command(self, cavity, temperature) -> dict[str, Any]:
|
|
94
|
+
def get_set_cavity_temperature_f_command(self, cavity: str, temperature: float) -> dict[str, Any]:
|
|
95
95
|
return {
|
|
96
96
|
cavity: {self._config.get_property(TARGET_TEMPERATURE_F): temperature}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
def get_set_cavity_temperature_c_command(self, cavity, temperature) -> dict[str, Any]:
|
|
99
|
+
def get_set_cavity_temperature_c_command(self, cavity: str, temperature: float) -> dict[str, Any]:
|
|
100
100
|
return {
|
|
101
101
|
cavity: {self._config.get_property(TARGET_TEMPERATURE_C): temperature}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
def get_set_vacation_holiday_mode_command(self, value) -> dict[str, Any]:
|
|
104
|
+
def get_set_vacation_holiday_mode_command(self, value: str) -> dict[str, Any]:
|
|
105
105
|
return {self._config.get_property(VACATION_HOLIDAY_MODE): value}
|
|
@@ -22,7 +22,7 @@ class DAMACAppliance(ApplianceData):
|
|
|
22
22
|
capabilities = self.details.capabilities if self.details else {}
|
|
23
23
|
self._config = DamAcConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
24
24
|
|
|
25
|
-
def is_feature_supported(self, feature) -> bool:
|
|
25
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
26
26
|
return self._config.is_capability_supported(feature)
|
|
27
27
|
|
|
28
28
|
def is_air_conditioner_feature_supported(self, feature: str) -> bool:
|
|
@@ -72,7 +72,7 @@ class DAMACAppliance(ApplianceData):
|
|
|
72
72
|
"""Return the current fan speed setting."""
|
|
73
73
|
return self._config.get_current_fan_speed(self.state.properties.get(REPORTED))
|
|
74
74
|
|
|
75
|
-
def get_fan_speed_command(self, fan_speed) -> dict[str, Any]:
|
|
75
|
+
def get_fan_speed_command(self, fan_speed: str) -> dict[str, Any]:
|
|
76
76
|
"""Return the command payload to set the fan speed."""
|
|
77
77
|
return {
|
|
78
78
|
self._config.get_property(AIR_CONDITIONER): {
|
|
@@ -80,7 +80,7 @@ class DAMACAppliance(ApplianceData):
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
def get_mode_command(self, mode) -> dict[str, Any]:
|
|
83
|
+
def get_mode_command(self, mode: str) -> dict[str, Any]:
|
|
84
84
|
"""Return the command payload to set the mode."""
|
|
85
85
|
return {
|
|
86
86
|
self._config.get_property(AIR_CONDITIONER): {
|
|
@@ -88,7 +88,7 @@ class DAMACAppliance(ApplianceData):
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
def get_temperature_command(self, temperature) -> dict[str, Any]:
|
|
91
|
+
def get_temperature_command(self, temperature: float) -> dict[str, Any]:
|
|
92
92
|
"""Return the command payload to set the temperature in Celsius."""
|
|
93
93
|
return {
|
|
94
94
|
self._config.get_property(AIR_CONDITIONER): {
|
|
@@ -21,7 +21,7 @@ class DHAppliance(ApplianceData):
|
|
|
21
21
|
capabilities = self.details.capabilities if self.details else {}
|
|
22
22
|
self._config = DhConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
23
23
|
|
|
24
|
-
def is_feature_supported(self, feature) -> bool:
|
|
24
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
25
25
|
return self._config.is_capability_supported(feature)
|
|
26
26
|
|
|
27
27
|
def is_appliance_on(self) -> bool:
|
|
@@ -68,20 +68,20 @@ class DHAppliance(ApplianceData):
|
|
|
68
68
|
"""Return the current ambient humidity."""
|
|
69
69
|
return self._config.get_current_sensor_humidity(self.state.properties.get(REPORTED))
|
|
70
70
|
|
|
71
|
-
def get_fan_speed_command(self, fan_speed) -> dict[str, Any]:
|
|
71
|
+
def get_fan_speed_command(self, fan_speed: str) -> dict[str, Any]:
|
|
72
72
|
"""Return the command payload to set a new fan speed."""
|
|
73
73
|
return {
|
|
74
74
|
self._config.get_property(FAN_SPEED): fan_speed
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
def get_mode_command(self, mode) -> dict[str, Any]:
|
|
77
|
+
def get_mode_command(self, mode: str) -> dict[str, Any]:
|
|
78
78
|
"""Return the command payload to set a new mode, or turn off if the mode is 'off'."""
|
|
79
79
|
if mode == self._config.get_property(MODE_OFF):
|
|
80
80
|
return self.get_turn_off_command()
|
|
81
81
|
else:
|
|
82
82
|
return {self._config.get_property(MODE): mode}
|
|
83
83
|
|
|
84
|
-
def get_humidity_command(self, humidity) -> dict[str, Any]:
|
|
84
|
+
def get_humidity_command(self, humidity: int) -> dict[str, Any]:
|
|
85
85
|
"""Return the command payload to set a target humidity."""
|
|
86
86
|
return {
|
|
87
87
|
self._config.get_property(TARGET_HUMIDITY): humidity
|
|
@@ -22,7 +22,7 @@ class DWAppliance(ApplianceData):
|
|
|
22
22
|
capabilities = self.details.capabilities if self.details else {}
|
|
23
23
|
self._config = DwConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
24
24
|
|
|
25
|
-
def is_feature_supported(self, feature) -> bool:
|
|
25
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
26
26
|
return self._config.is_capability_supported(feature)
|
|
27
27
|
|
|
28
28
|
def get_supported_programs(self) -> list[str]:
|
|
@@ -21,7 +21,7 @@ class HBAppliance(ApplianceData):
|
|
|
21
21
|
capabilities = self.details.capabilities if self.details else {}
|
|
22
22
|
self._config = HbConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
23
23
|
|
|
24
|
-
def is_feature_supported(self, feature) -> bool:
|
|
24
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
25
25
|
return self._config.is_capability_supported(feature)
|
|
26
26
|
|
|
27
27
|
def is_hood_feature_supported(self, feature: str) -> bool:
|
|
@@ -106,7 +106,7 @@ class HBAppliance(ApplianceData):
|
|
|
106
106
|
"""Return the current zone hob pot detected."""
|
|
107
107
|
return self._config.get_current_zone_hob_pot_detected(hob_zone, self.state.properties.get(REPORTED))
|
|
108
108
|
|
|
109
|
-
def get_hood_fan_speed_command(self, fan_speed) -> dict[str, Any]:
|
|
109
|
+
def get_hood_fan_speed_command(self, fan_speed: str) -> dict[str, Any]:
|
|
110
110
|
"""Return the command payload to set a new hood fan speed."""
|
|
111
111
|
return {
|
|
112
112
|
self._config.get_property(HOB_HOOD): {
|
|
@@ -114,7 +114,7 @@ class HBAppliance(ApplianceData):
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
def get_hood_state_command(self, state) -> dict[str, Any]:
|
|
117
|
+
def get_hood_state_command(self, state: str) -> dict[str, Any]:
|
|
118
118
|
"""Return the command payload to set a new hood state."""
|
|
119
119
|
return {
|
|
120
120
|
self._config.get_property(HOB_HOOD): {
|
|
@@ -122,7 +122,7 @@ class HBAppliance(ApplianceData):
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
def get_key_sound_tone_command(self, tone) -> dict[str, Any]:
|
|
125
|
+
def get_key_sound_tone_command(self, tone: str) -> dict[str, Any]:
|
|
126
126
|
"""Return the command payload to set the key sound tone."""
|
|
127
127
|
return {
|
|
128
128
|
self._config.get_property(KEY_SOUND_TONE): tone
|
|
@@ -21,7 +21,7 @@ class HDAppliance(ApplianceData):
|
|
|
21
21
|
capabilities = self.details.capabilities if self.details else {}
|
|
22
22
|
self._config = HdConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
23
23
|
|
|
24
|
-
def is_feature_supported(self, feature) -> bool:
|
|
24
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
25
25
|
return self._config.is_capability_supported(feature)
|
|
26
26
|
|
|
27
27
|
def get_supported_hood_fan_level(self) -> list[str]:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import PrivateAttr
|
|
5
5
|
|
|
@@ -22,39 +22,39 @@ class OVAppliance(ApplianceData):
|
|
|
22
22
|
capabilities = self.details.capabilities if self.details else {}
|
|
23
23
|
self._config = OvConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
24
24
|
|
|
25
|
-
def is_feature_supported(self, feature) -> bool:
|
|
25
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
26
26
|
return self._config.is_capability_supported(feature)
|
|
27
27
|
|
|
28
28
|
def get_supported_programs(self) -> list[str]:
|
|
29
29
|
"""Return a list of supported modes."""
|
|
30
30
|
return self._config.get_supported_programs()
|
|
31
31
|
|
|
32
|
-
def get_supported_min_temp(self, program: str = None) -> float:
|
|
32
|
+
def get_supported_min_temp(self, program: Optional[str] = None) -> float:
|
|
33
33
|
"""Return the minimum supported temperature."""
|
|
34
34
|
current_program = program if program is not None else self.get_current_program()
|
|
35
35
|
return self._config.get_temperature_range(current_program, self.state.properties.get(REPORTED)).get(MIN)
|
|
36
36
|
|
|
37
|
-
def get_supported_max_temp(self, program: str = None) -> float:
|
|
37
|
+
def get_supported_max_temp(self, program: Optional[str] = None) -> float:
|
|
38
38
|
"""Return the maximum supported temperature."""
|
|
39
39
|
current_program = program if program is not None else self.get_current_program()
|
|
40
40
|
return self._config.get_temperature_range(current_program, self.state.properties.get(REPORTED)).get(MAX)
|
|
41
41
|
|
|
42
|
-
def get_supported_step_temp(self, program: str = None) -> float:
|
|
42
|
+
def get_supported_step_temp(self, program: Optional[str] = None) -> float:
|
|
43
43
|
"""Return the step increment for temperature control."""
|
|
44
44
|
current_program = program if program is not None else self.get_current_program()
|
|
45
45
|
return self._config.get_temperature_range(current_program, self.state.properties.get(REPORTED)).get(STEP)
|
|
46
46
|
|
|
47
|
-
def get_supported_min_duration(self, program: str = None) -> float:
|
|
47
|
+
def get_supported_min_duration(self, program: Optional[str] = None) -> float:
|
|
48
48
|
"""Return the minimum supported timer duration."""
|
|
49
49
|
current_program = program if program is not None else self.get_current_program()
|
|
50
50
|
return self._config.get_timer_range(current_program).get(MIN)
|
|
51
51
|
|
|
52
|
-
def get_supported_max_duration(self, program: str = None) -> float:
|
|
52
|
+
def get_supported_max_duration(self, program: Optional[str] = None) -> float:
|
|
53
53
|
"""Return the maximum supported timer duration."""
|
|
54
54
|
current_program = program if program is not None else self.get_current_program()
|
|
55
55
|
return self._config.get_timer_range(current_program).get(MAX)
|
|
56
56
|
|
|
57
|
-
def get_supported_step_duration(self, program: str = None) -> float:
|
|
57
|
+
def get_supported_step_duration(self, program: Optional[str] = None) -> float:
|
|
58
58
|
"""Return the step increment for timer duration control."""
|
|
59
59
|
current_program = program if program is not None else self.get_current_program()
|
|
60
60
|
return self._config.get_timer_range(current_program).get(STEP)
|
|
@@ -131,7 +131,7 @@ class OVAppliance(ApplianceData):
|
|
|
131
131
|
"""Get the current display food probe temperature c from the reported state."""
|
|
132
132
|
return self._config.get_current_display_food_probe_temperature_c(self.state.properties.get(REPORTED))
|
|
133
133
|
|
|
134
|
-
def get_program_command(self, program) -> dict[str, Any]:
|
|
134
|
+
def get_program_command(self, program: str) -> dict[str, Any]:
|
|
135
135
|
"""Return the command payload to set the program."""
|
|
136
136
|
return {
|
|
137
137
|
self._config.get_property(PROGRAM): program
|
|
@@ -143,13 +143,13 @@ class OVAppliance(ApplianceData):
|
|
|
143
143
|
self._config.get_property(CAVITY_LIGHT): on
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
def get_temperature_c_command(self, temperature) -> dict[str, Any]:
|
|
146
|
+
def get_temperature_c_command(self, temperature: float) -> dict[str, Any]:
|
|
147
147
|
"""Return the command payload to set the temperature in Celsius."""
|
|
148
148
|
return {
|
|
149
149
|
self._config.get_property(TARGET_TEMPERATURE_C): temperature
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
def get_temperature_f_command(self, temperature) -> dict[str, Any]:
|
|
152
|
+
def get_temperature_f_command(self, temperature: float) -> dict[str, Any]:
|
|
153
153
|
"""Return the command payload to set the temperature in Fahrenheit."""
|
|
154
154
|
return {
|
|
155
155
|
self._config.get_property(TARGET_TEMPERATURE_F): temperature
|
|
@@ -23,7 +23,7 @@ class RVCAppliance(ApplianceData):
|
|
|
23
23
|
capabilities = self.details.capabilities if self.details else {}
|
|
24
24
|
self._config = RvcConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
25
25
|
|
|
26
|
-
def is_feature_supported(self, feature) -> bool:
|
|
26
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
27
27
|
return self._config.is_capability_supported(feature)
|
|
28
28
|
|
|
29
29
|
def get_supported_modes(self) -> list[str]:
|
|
@@ -104,9 +104,9 @@ class RVCAppliance(ApplianceData):
|
|
|
104
104
|
def get_gordias_start_room_cleaning_command(self, map_id: int,
|
|
105
105
|
room_ids: list[int],
|
|
106
106
|
sweep_mode: int = 0,
|
|
107
|
-
vacuum_mode="standard",
|
|
108
|
-
water_pump_rate="off",
|
|
109
|
-
number_of_repetitions=1) -> dict[str, Any]:
|
|
107
|
+
vacuum_mode: str = "standard",
|
|
108
|
+
water_pump_rate: str = "off",
|
|
109
|
+
number_of_repetitions: int = 1) -> dict[str, Any]:
|
|
110
110
|
return {
|
|
111
111
|
MAP_COMMAND: "selectRoomsClean",
|
|
112
112
|
MAP_ID: map_id,
|
|
@@ -126,10 +126,10 @@ class RVCAppliance(ApplianceData):
|
|
|
126
126
|
def get_cybele_start_room_cleaning_command(self, map_id: int,
|
|
127
127
|
room_ids_names: list[tuple[int, str]],
|
|
128
128
|
global_settings_cleaning: bool = True,
|
|
129
|
-
cleaning_type="vacuum",
|
|
130
|
-
vacuum_mode="standard",
|
|
131
|
-
water_pump_rate="off",
|
|
132
|
-
number_of_repetitions=1) -> dict[str, Any]:
|
|
129
|
+
cleaning_type: str = "vacuum",
|
|
130
|
+
vacuum_mode: str = "standard",
|
|
131
|
+
water_pump_rate: str = "off",
|
|
132
|
+
number_of_repetitions: int = 1) -> dict[str, Any]:
|
|
133
133
|
if global_settings_cleaning:
|
|
134
134
|
return {
|
|
135
135
|
MAP_COMMAND: "selectRoomsClean",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import PrivateAttr
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ class SOAppliance(ApplianceData):
|
|
|
22
22
|
capabilities = self.details.capabilities if self.details else {}
|
|
23
23
|
self._config = SoConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
24
24
|
|
|
25
|
-
def is_feature_supported(self, feature) -> bool:
|
|
25
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
26
26
|
return self._config.is_capability_supported(feature)
|
|
27
27
|
|
|
28
28
|
def is_cavity_feature_supported(self, cavity: str, feature) -> bool:
|
|
@@ -32,101 +32,101 @@ class SOAppliance(ApplianceData):
|
|
|
32
32
|
"""Get supported cavities name from the capabilities."""
|
|
33
33
|
return self._config.get_supported_cavities()
|
|
34
34
|
|
|
35
|
-
def get_cavity_supported_programs(self, cavity) -> list[str]:
|
|
35
|
+
def get_cavity_supported_programs(self, cavity: str) -> list[str]:
|
|
36
36
|
"""Return a list of cavity supported modes."""
|
|
37
37
|
return self._config.get_cavity_supported_programs(cavity)
|
|
38
38
|
|
|
39
|
-
def get_cavity_supported_min_temp(self, cavity, program: str = None) -> float:
|
|
39
|
+
def get_cavity_supported_min_temp(self, cavity: str, program: Optional[str] = None) -> float:
|
|
40
40
|
"""Return the minimum cavity supported temperature."""
|
|
41
41
|
current_program = program if program is not None else self.get_current_cavity_program(cavity)
|
|
42
42
|
return self._config.get_cavity_temperature_range(cavity, current_program,
|
|
43
43
|
self.state.properties.get(REPORTED)).get(MIN)
|
|
44
44
|
|
|
45
|
-
def get_cavity_supported_max_temp(self, cavity, program: str = None) -> float:
|
|
45
|
+
def get_cavity_supported_max_temp(self, cavity: str, program: Optional[str] = None) -> float:
|
|
46
46
|
"""Return the maximum cavity supported temperature."""
|
|
47
47
|
current_program = program if program is not None else self.get_current_cavity_program(cavity)
|
|
48
48
|
return self._config.get_cavity_temperature_range(cavity, current_program,
|
|
49
49
|
self.state.properties.get(REPORTED)).get(MAX)
|
|
50
50
|
|
|
51
|
-
def get_cavity_supported_step_temp(self, cavity, program: str = None) -> float:
|
|
51
|
+
def get_cavity_supported_step_temp(self, cavity: str, program: Optional[str] = None) -> float:
|
|
52
52
|
"""Return the cavity step increment for temperature control."""
|
|
53
53
|
current_program = program if program is not None else self.get_current_cavity_program(cavity)
|
|
54
54
|
return self._config.get_cavity_temperature_range(cavity, current_program,
|
|
55
55
|
self.state.properties.get(REPORTED)).get(STEP)
|
|
56
56
|
|
|
57
|
-
def get_cavity_supported_min_duration(self, cavity, program: str = None) -> float:
|
|
57
|
+
def get_cavity_supported_min_duration(self, cavity: str, program: Optional[str] = None) -> float:
|
|
58
58
|
"""Return the minimum cavity supported timer duration."""
|
|
59
59
|
current_program = program if program is not None else self.get_current_cavity_program(cavity)
|
|
60
60
|
return self._config.get_cavity_timer_range(cavity, current_program).get(MIN)
|
|
61
61
|
|
|
62
|
-
def get_cavity_supported_max_duration(self, cavity, program: str = None) -> float:
|
|
62
|
+
def get_cavity_supported_max_duration(self, cavity: str, program: Optional[str] = None) -> float:
|
|
63
63
|
"""Return the maximum cavity supported timer duration."""
|
|
64
64
|
current_program = program if program is not None else self.get_current_cavity_program(cavity)
|
|
65
65
|
return self._config.get_cavity_timer_range(cavity, current_program).get(MAX)
|
|
66
66
|
|
|
67
|
-
def get_cavity_supported_step_duration(self, cavity, program: str = None) -> float:
|
|
67
|
+
def get_cavity_supported_step_duration(self, cavity: str, program: Optional[str] = None) -> float:
|
|
68
68
|
"""Return the cavity step increment for timer duration control."""
|
|
69
69
|
current_program = program if program is not None else self.get_current_cavity_program(cavity)
|
|
70
70
|
return self._config.get_cavity_timer_range(cavity, current_program).get(STEP)
|
|
71
71
|
|
|
72
|
-
def get_current_cavity_program(self, cavity) -> str:
|
|
72
|
+
def get_current_cavity_program(self, cavity: str) -> str:
|
|
73
73
|
"""Return the current cavity program."""
|
|
74
74
|
return self._config.get_current_cavity_program(cavity, self.state.properties.get(REPORTED))
|
|
75
75
|
|
|
76
|
-
def get_current_cavity_target_temperature_c(self, cavity) -> float:
|
|
76
|
+
def get_current_cavity_target_temperature_c(self, cavity: str) -> float:
|
|
77
77
|
"""Return the current cavity target temperature in Celsius."""
|
|
78
78
|
return self._config.get_current_cavity_target_temperature_c(cavity, self.state.properties.get(REPORTED))
|
|
79
79
|
|
|
80
|
-
def get_current_cavity_target_temperature_f(self, cavity) -> float:
|
|
80
|
+
def get_current_cavity_target_temperature_f(self, cavity: str) -> float:
|
|
81
81
|
"""Return the current cavity target temperature in Fahrenheit."""
|
|
82
82
|
return self._config.get_current_cavity_target_temperature_f(cavity, self.state.properties.get(REPORTED))
|
|
83
83
|
|
|
84
|
-
def get_current_cavity_display_temperature_c(self, cavity) -> float:
|
|
84
|
+
def get_current_cavity_display_temperature_c(self, cavity: str) -> float:
|
|
85
85
|
"""Return the current cavity display temperature in Celsius."""
|
|
86
86
|
return self._config.get_current_cavity_display_temperature_c(cavity, self.state.properties.get(REPORTED))
|
|
87
87
|
|
|
88
|
-
def get_current_cavity_display_temperature_f(self, cavity) -> float:
|
|
88
|
+
def get_current_cavity_display_temperature_f(self, cavity: str) -> float:
|
|
89
89
|
"""Return the current cavity display temperature in Fahrenheit."""
|
|
90
90
|
return self._config.get_current_cavity_display_temperature_f(cavity, self.state.properties.get(REPORTED))
|
|
91
91
|
|
|
92
|
-
def get_current_cavity_appliance_state(self, cavity) -> str:
|
|
92
|
+
def get_current_cavity_appliance_state(self, cavity: str) -> str:
|
|
93
93
|
"""Return the current cavity appliance state."""
|
|
94
94
|
return self._config.get_current_cavity_appliance_state(cavity, self.state.properties.get(REPORTED))
|
|
95
95
|
|
|
96
|
-
def get_current_cavity_door_state(self, cavity) -> str:
|
|
96
|
+
def get_current_cavity_door_state(self, cavity: str) -> str:
|
|
97
97
|
"""Get the current cavity door state from the reported state."""
|
|
98
98
|
return self._config.get_current_cavity_door_state(cavity, self.state.properties.get(REPORTED))
|
|
99
99
|
|
|
100
|
-
def get_current_cavity_running_time(self, cavity) -> int:
|
|
100
|
+
def get_current_cavity_running_time(self, cavity: str) -> int:
|
|
101
101
|
"""Get the current cavity running time from the reported state."""
|
|
102
102
|
return self._config.get_current_cavity_running_time(cavity, self.state.properties.get(REPORTED))
|
|
103
103
|
|
|
104
|
-
def get_current_cavity_time_to_end(self, cavity) -> int:
|
|
104
|
+
def get_current_cavity_time_to_end(self, cavity: str) -> int:
|
|
105
105
|
"""Get the current cavity time to end from the reported state."""
|
|
106
106
|
return self._config.get_current_cavity_time_to_end(cavity, self.state.properties.get(REPORTED))
|
|
107
107
|
|
|
108
|
-
def get_current_cavity_target_duration(self, cavity) -> int:
|
|
108
|
+
def get_current_cavity_target_duration(self, cavity: str) -> int:
|
|
109
109
|
"""Get the current cavity target duration from the reported state."""
|
|
110
110
|
return self._config.get_current_cavity_target_duration(cavity, self.state.properties.get(REPORTED))
|
|
111
111
|
|
|
112
|
-
def get_current_cavity_start_at(self, cavity) -> datetime:
|
|
112
|
+
def get_current_cavity_start_at(self, cavity: str) -> datetime:
|
|
113
113
|
"""Get the current cavity start at time from the reported state."""
|
|
114
114
|
return self._config.get_current_cavity_start_at(cavity, self.state.properties.get(REPORTED))
|
|
115
115
|
|
|
116
|
-
def get_current_cavity_cavity_light(self, cavity) -> bool:
|
|
116
|
+
def get_current_cavity_cavity_light(self, cavity: str) -> bool:
|
|
117
117
|
"""Get the current cavity cavity light from the reported state."""
|
|
118
118
|
return self._config.get_current_cavity_cavity_light(cavity, self.state.properties.get(REPORTED))
|
|
119
119
|
|
|
120
|
-
def get_current_cavity_food_probe_insertion_state(self, cavity) -> str:
|
|
120
|
+
def get_current_cavity_food_probe_insertion_state(self, cavity: str) -> str:
|
|
121
121
|
"""Get the current cavity food probe insertion state from the reported state."""
|
|
122
122
|
return self._config.get_current_cavity_food_probe_insertion_state(cavity, self.state.properties.get(REPORTED))
|
|
123
123
|
|
|
124
|
-
def get_current_cavity_display_food_probe_temperature_f(self, cavity) -> float:
|
|
124
|
+
def get_current_cavity_display_food_probe_temperature_f(self, cavity: str) -> float:
|
|
125
125
|
"""Get the current cavity display food probe temperature f from the reported state."""
|
|
126
126
|
return self._config.get_current_cavity_display_food_probe_temperature_f(cavity,
|
|
127
127
|
self.state.properties.get(REPORTED))
|
|
128
128
|
|
|
129
|
-
def get_current_cavity_display_food_probe_temperature_c(self, cavity) -> float:
|
|
129
|
+
def get_current_cavity_display_food_probe_temperature_c(self, cavity: str) -> float:
|
|
130
130
|
"""Get the current cavity display food probe temperature c from the reported state."""
|
|
131
131
|
return self._config.get_current_cavity_display_food_probe_temperature_c(cavity,
|
|
132
132
|
self.state.properties.get(REPORTED))
|
|
@@ -143,30 +143,30 @@ class SOAppliance(ApplianceData):
|
|
|
143
143
|
"""Return the current temperature unit."""
|
|
144
144
|
return self._config.get_current_temperature_unit(self.state.properties.get(REPORTED))
|
|
145
145
|
|
|
146
|
-
def get_program_command(self, cavity, program) -> dict[str, Any]:
|
|
146
|
+
def get_program_command(self, cavity: str, program: str) -> dict[str, Any]:
|
|
147
147
|
"""Return the command payload to set the cavity program."""
|
|
148
148
|
return {cavity: {self._config.get_property(PROGRAM): program}}
|
|
149
149
|
|
|
150
|
-
def get_cavity_light_command(self, cavity, on: bool) -> dict[str, Any]:
|
|
150
|
+
def get_cavity_light_command(self, cavity: str, on: bool) -> dict[str, Any]:
|
|
151
151
|
"""Return the command payload to set the cavity cavity light."""
|
|
152
152
|
return {cavity: {self._config.get_property(CAVITY_LIGHT): on}}
|
|
153
153
|
|
|
154
|
-
def get_temperature_c_command(self, cavity, temperature) -> dict[str, Any]:
|
|
154
|
+
def get_temperature_c_command(self, cavity: str, temperature: float) -> dict[str, Any]:
|
|
155
155
|
"""Return the command payload to set the temperature in Celsius."""
|
|
156
156
|
return {cavity: {self._config.get_property(TARGET_TEMPERATURE_C): temperature}}
|
|
157
157
|
|
|
158
|
-
def get_temperature_f_command(self, cavity, temperature) -> dict[str, Any]:
|
|
158
|
+
def get_temperature_f_command(self, cavity: str, temperature: float) -> dict[str, Any]:
|
|
159
159
|
"""Return the command payload to set the temperature in Fahrenheit."""
|
|
160
160
|
return {cavity: {self._config.get_property(TARGET_TEMPERATURE_F): temperature}}
|
|
161
161
|
|
|
162
|
-
def get_target_duration_command(self, cavity, duration_sec: int) -> dict[str, Any]:
|
|
162
|
+
def get_target_duration_command(self, cavity: str, duration_sec: int) -> dict[str, Any]:
|
|
163
163
|
"""Return the command payload to set the target duration."""
|
|
164
164
|
return {cavity: {self._config.get_property(TARGET_DURATION): duration_sec}}
|
|
165
165
|
|
|
166
|
-
def get_start_command(self, cavity) -> dict[str, Any]:
|
|
166
|
+
def get_start_command(self, cavity: str) -> dict[str, Any]:
|
|
167
167
|
"""Return the command payload to turn the appliance ON."""
|
|
168
168
|
return {cavity: {self._config.get_property(EXECUTE_COMMAND): "START"}}
|
|
169
169
|
|
|
170
|
-
def get_stop_command(self, cavity) -> dict[str, Any]:
|
|
170
|
+
def get_stop_command(self, cavity: str) -> dict[str, Any]:
|
|
171
171
|
"""Return the command payload to turn the appliance OFF."""
|
|
172
172
|
return {cavity: {self._config.get_property(EXECUTE_COMMAND): "STOPRESET"}}
|
|
@@ -22,7 +22,7 @@ class TDAppliance(ApplianceData):
|
|
|
22
22
|
capabilities = self.details.capabilities if self.details else {}
|
|
23
23
|
self._config = TdConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
24
24
|
|
|
25
|
-
def is_feature_supported(self, feature) -> bool:
|
|
25
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
26
26
|
return self._config.is_capability_supported(feature)
|
|
27
27
|
|
|
28
28
|
def get_supported_programs(self) -> list[str]:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import PrivateAttr
|
|
5
5
|
|
|
@@ -23,19 +23,19 @@ class WDAppliance(ApplianceData):
|
|
|
23
23
|
capabilities = self.details.capabilities if self.details else {}
|
|
24
24
|
self._config = WdConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
25
25
|
|
|
26
|
-
def is_feature_supported(self, feature) -> bool:
|
|
26
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
27
27
|
return self._config.is_capability_supported(feature)
|
|
28
28
|
|
|
29
29
|
def get_supported_programs(self) -> list[str]:
|
|
30
30
|
"""Get appliance programs."""
|
|
31
31
|
return self._config.get_supported_programs()
|
|
32
32
|
|
|
33
|
-
def get_supported_spin_speeds(self, program: str = None) -> list[str]:
|
|
33
|
+
def get_supported_spin_speeds(self, program: Optional[str] = None) -> list[str]:
|
|
34
34
|
"""Get appliance spin speeds."""
|
|
35
35
|
current_program = program if program is not None else self.get_current_program()
|
|
36
36
|
return self._config.get_supported_spin_speeds(current_program)
|
|
37
37
|
|
|
38
|
-
def get_supported_temperature(self, program: str = None) -> list[str]:
|
|
38
|
+
def get_supported_temperature(self, program: Optional[str] = None) -> list[str]:
|
|
39
39
|
"""Get appliance temperature."""
|
|
40
40
|
current_program = program if program is not None else self.get_current_program()
|
|
41
41
|
return self._config.get_supported_temperature(current_program)
|
|
@@ -179,7 +179,7 @@ class WDAppliance(ApplianceData):
|
|
|
179
179
|
self._config.get_property(PROGRAM_UID): program}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
def get_set_spin_speed_command(self, spin_speed: str, program: str = None):
|
|
182
|
+
def get_set_spin_speed_command(self, spin_speed: str, program: Optional[str] = None):
|
|
183
183
|
"""Return the command payload to set the spin speed. The program needs to be included in the command."""
|
|
184
184
|
program = program if program is not None else self._config.get_current_program(
|
|
185
185
|
self.state.properties.get(REPORTED))
|
|
@@ -189,7 +189,7 @@ class WDAppliance(ApplianceData):
|
|
|
189
189
|
self._config.get_property(ANALOG_SPIN_SPEED): spin_speed}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
def get_set_temperature_command(self, temperature: str, program: str = None):
|
|
192
|
+
def get_set_temperature_command(self, temperature: str, program: Optional[str] = None):
|
|
193
193
|
"""Return the command payload to set the temperature. The program needs to be included in the command."""
|
|
194
194
|
program = program if program is not None else self._config.get_current_program(
|
|
195
195
|
self.state.properties.get(REPORTED))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import PrivateAttr
|
|
5
5
|
|
|
@@ -23,19 +23,19 @@ class WMAppliance(ApplianceData):
|
|
|
23
23
|
capabilities = self.details.capabilities if self.details else {}
|
|
24
24
|
self._config = WmConfigManager().get_config(self.appliance.applianceType, capabilities)
|
|
25
25
|
|
|
26
|
-
def is_feature_supported(self, feature) -> bool:
|
|
26
|
+
def is_feature_supported(self, feature: str | list[str]) -> bool:
|
|
27
27
|
return self._config.is_capability_supported(feature)
|
|
28
28
|
|
|
29
29
|
def get_supported_programs(self) -> list[str]:
|
|
30
30
|
"""Get appliance programs."""
|
|
31
31
|
return self._config.get_supported_programs()
|
|
32
32
|
|
|
33
|
-
def get_supported_spin_speeds(self, program: str = None) -> list[str]:
|
|
33
|
+
def get_supported_spin_speeds(self, program: Optional[str] = None) -> list[str]:
|
|
34
34
|
"""Get appliance spin speeds."""
|
|
35
35
|
current_program = program if program is not None else self.get_current_program()
|
|
36
36
|
return self._config.get_supported_spin_speeds(current_program)
|
|
37
37
|
|
|
38
|
-
def get_supported_temperature(self, program: str = None) -> list[str]:
|
|
38
|
+
def get_supported_temperature(self, program: Optional[str] = None) -> list[str]:
|
|
39
39
|
"""Get appliance temperature."""
|
|
40
40
|
current_program = program if program is not None else self.get_current_program()
|
|
41
41
|
return self._config.get_supported_temperature(current_program)
|
|
@@ -179,7 +179,7 @@ class WMAppliance(ApplianceData):
|
|
|
179
179
|
self._config.get_property(PROGRAM_UID): program}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
def get_set_spin_speed_command(self, spin_speed: str, program: str = None):
|
|
182
|
+
def get_set_spin_speed_command(self, spin_speed: str, program: Optional[str] = None):
|
|
183
183
|
"""Return the command payload to set the spin speed. The program needs to be included in the command."""
|
|
184
184
|
program = program if program is not None else self._config.get_current_program(
|
|
185
185
|
self.state.properties.get(REPORTED))
|
|
@@ -189,7 +189,7 @@ class WMAppliance(ApplianceData):
|
|
|
189
189
|
self._config.get_property(ANALOG_SPIN_SPEED): spin_speed}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
def get_set_temperature_command(self, temperature: str, program: str = None):
|
|
192
|
+
def get_set_temperature_command(self, temperature: str, program: Optional[str] = None):
|
|
193
193
|
"""Return the command payload to set the temperature. The program needs to be included in the command."""
|
|
194
194
|
program = program if program is not None else self._config.get_current_program(
|
|
195
195
|
self.state.properties.get(REPORTED))
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
class ApplianceClientException(Exception):
|
|
2
5
|
"""Base exception for errors raised by the Appliance client."""
|
|
3
6
|
|
|
4
|
-
def __init__(self, message: str = "An unknown error occurred in the Appiance client.", status: int
|
|
7
|
+
def __init__(self, message: str = "An unknown error occurred in the Appiance client.", status: Optional[int] = None):
|
|
5
8
|
super().__init__(message)
|
|
6
9
|
self.status = status
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import Any
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel
|
|
4
4
|
|
|
@@ -15,4 +15,4 @@ class ApplianceInfo(BaseModel):
|
|
|
15
15
|
|
|
16
16
|
class ApplianceDetails(BaseModel):
|
|
17
17
|
applianceInfo: ApplianceInfo
|
|
18
|
-
capabilities:
|
|
18
|
+
capabilities: dict[str, Any]
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
class FailedConnectionException(Exception):
|
|
2
5
|
"""Exception raised when connection fails"""
|
|
3
6
|
|
|
4
|
-
def __init__(self, message: str = "The connection failed.", status_code: int
|
|
7
|
+
def __init__(self, message: str = "The connection failed.", status_code: Optional[int] = None):
|
|
5
8
|
super().__init__(message)
|
|
6
9
|
self.status_code = status_code
|
{electrolux_group_developer_sdk-0.1.2 → electrolux_group_developer_sdk-0.1.3}/pyproject.toml
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "electrolux-group-developer-sdk"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
4
4
|
description = "A Python async client library for interacting with the Electrolux Developer Portal API."
|
|
5
5
|
authors = ["Electrolux Developer Portal Team <devportal@electrolux.com>"]
|
|
6
6
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|