weheat 2024.11.1__py3-none-any.whl → 2025.11.24rc1__py3-none-any.whl
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.
- weheat/__init__.py +6 -2
- weheat/abstractions/__init__.py +1 -1
- weheat/abstractions/discovery.py +11 -7
- weheat/abstractions/heat_pump.py +223 -81
- weheat/abstractions/user.py +16 -11
- weheat/api/__init__.py +1 -0
- weheat/api/energy_log_api.py +615 -127
- weheat/api/heat_pump_api.py +580 -374
- weheat/api/heat_pump_log_api.py +884 -360
- weheat/api/user_api.py +260 -115
- weheat/api_client.py +238 -265
- weheat/api_response.py +11 -15
- weheat/configuration.py +14 -9
- weheat/exceptions.py +59 -25
- weheat/models/__init__.py +8 -0
- weheat/models/boiler_type.py +8 -3
- weheat/models/device_state.py +9 -5
- weheat/models/dhw_type.py +8 -3
- weheat/models/energy_view_dto.py +87 -65
- weheat/models/heat_pump_log_view_dto.py +1394 -559
- weheat/models/heat_pump_model.py +8 -3
- weheat/models/heat_pump_status_enum.py +9 -4
- weheat/models/pagination_metadata.py +95 -0
- weheat/models/raw_heat_pump_log_dto.py +438 -375
- weheat/models/raw_heatpump_log_and_is_online_dto.py +578 -0
- weheat/models/read_all_heat_pump_dto.py +69 -53
- weheat/models/read_all_heat_pump_dto_paged_response.py +107 -0
- weheat/models/read_heat_pump_dto.py +64 -48
- weheat/models/read_user_dto.py +55 -37
- weheat/models/read_user_me_dto.py +124 -0
- weheat/models/role.py +10 -4
- weheat/models/total_energy_aggregate.py +111 -0
- weheat/rest.py +152 -259
- weheat-2025.11.24rc1.dist-info/METADATA +104 -0
- weheat-2025.11.24rc1.dist-info/RECORD +39 -0
- {weheat-2024.11.1.dist-info → weheat-2025.11.24rc1.dist-info}/WHEEL +1 -1
- weheat/abstractions/auth.py +0 -34
- weheat/models/heat_pump_type.py +0 -42
- weheat-2024.11.1.dist-info/METADATA +0 -107
- weheat-2024.11.1.dist-info/RECORD +0 -36
- {weheat-2024.11.1.dist-info → weheat-2025.11.24rc1.dist-info/licenses}/LICENSE +0 -0
- {weheat-2024.11.1.dist-info → weheat-2025.11.24rc1.dist-info}/top_level.txt +0 -0
weheat/models/heat_pump_model.py
CHANGED
|
@@ -12,13 +12,18 @@
|
|
|
12
12
|
""" # noqa: E501
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
15
16
|
import json
|
|
16
17
|
import pprint
|
|
17
18
|
import re # noqa: F401
|
|
18
|
-
from
|
|
19
|
+
from enum import Enum
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
try:
|
|
24
|
+
from typing import Self
|
|
25
|
+
except ImportError:
|
|
26
|
+
from typing_extensions import Self
|
|
22
27
|
|
|
23
28
|
|
|
24
29
|
class HeatPumpModel(int, Enum):
|
|
@@ -37,8 +42,8 @@ class HeatPumpModel(int, Enum):
|
|
|
37
42
|
NUMBER_5 = 5
|
|
38
43
|
|
|
39
44
|
@classmethod
|
|
40
|
-
def from_json(cls, json_str: str) ->
|
|
45
|
+
def from_json(cls, json_str: str) -> Self:
|
|
41
46
|
"""Create an instance of HeatPumpModel from a JSON string"""
|
|
42
|
-
return
|
|
47
|
+
return cls(json.loads(json_str))
|
|
43
48
|
|
|
44
49
|
|
|
@@ -12,18 +12,23 @@
|
|
|
12
12
|
""" # noqa: E501
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
15
16
|
import json
|
|
16
17
|
import pprint
|
|
17
18
|
import re # noqa: F401
|
|
18
|
-
from
|
|
19
|
+
from enum import Enum
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
try:
|
|
24
|
+
from typing import Self
|
|
25
|
+
except ImportError:
|
|
26
|
+
from typing_extensions import Self
|
|
22
27
|
|
|
23
28
|
|
|
24
29
|
class HeatPumpStatusEnum(int, Enum):
|
|
25
30
|
"""
|
|
26
|
-
Last status of the heat pump from the last heat pump log - Standby (40) - Heating (70) - Defrost (90) - Cooling (130) - DHW (150) - Lionelle (160) - SelfTest (170)
|
|
31
|
+
Last status of the heat pump from the last heat pump log - Standby (40) - Heating (70) - Defrost (90) - Cooling (130) - DHW (150) - Lionelle (160) - SelfTest (170) - ManualControl (180)
|
|
27
32
|
"""
|
|
28
33
|
|
|
29
34
|
"""
|
|
@@ -39,8 +44,8 @@ class HeatPumpStatusEnum(int, Enum):
|
|
|
39
44
|
NUMBER_180 = 180
|
|
40
45
|
|
|
41
46
|
@classmethod
|
|
42
|
-
def from_json(cls, json_str: str) ->
|
|
47
|
+
def from_json(cls, json_str: str) -> Self:
|
|
43
48
|
"""Create an instance of HeatPumpStatusEnum from a JSON string"""
|
|
44
|
-
return
|
|
49
|
+
return cls(json.loads(json_str))
|
|
45
50
|
|
|
46
51
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Weheat Backend
|
|
5
|
+
|
|
6
|
+
This is the backend for the Weheat project
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import BaseModel, StrictInt
|
|
23
|
+
from pydantic import Field
|
|
24
|
+
try:
|
|
25
|
+
from typing import Self
|
|
26
|
+
except ImportError:
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class PaginationMetadata(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
Metadata for pagination information
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
total_count: Optional[StrictInt] = Field(default=None, description="Amount of items in the database", alias="totalCount")
|
|
34
|
+
page_size: Optional[StrictInt] = Field(default=None, description="Size of the page", alias="pageSize")
|
|
35
|
+
current_page: Optional[StrictInt] = Field(default=None, description="Current page", alias="currentPage")
|
|
36
|
+
total_pages: Optional[StrictInt] = Field(default=None, description="Total amount of pages", alias="totalPages")
|
|
37
|
+
__properties: ClassVar[List[str]] = ["totalCount", "pageSize", "currentPage", "totalPages"]
|
|
38
|
+
|
|
39
|
+
model_config = {
|
|
40
|
+
"populate_by_name": True,
|
|
41
|
+
"validate_assignment": True,
|
|
42
|
+
"protected_namespaces": (),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Self:
|
|
57
|
+
"""Create an instance of PaginationMetadata from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude={
|
|
73
|
+
},
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
80
|
+
"""Create an instance of PaginationMetadata from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"totalCount": obj.get("totalCount"),
|
|
89
|
+
"pageSize": obj.get("pageSize"),
|
|
90
|
+
"currentPage": obj.get("currentPage"),
|
|
91
|
+
"totalPages": obj.get("totalPages")
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|