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
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
from datetime import datetime
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import BaseModel, StrictStr
|
|
23
|
+
from pydantic import Field
|
|
24
|
+
from weheat.models.role import Role
|
|
25
|
+
try:
|
|
26
|
+
from typing import Self
|
|
27
|
+
except ImportError:
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class ReadUserMeDto(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
ReadUserMeDto
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
id: StrictStr = Field(description="Identifier of the user")
|
|
35
|
+
first_name: Optional[StrictStr] = Field(default=None, description="First name of the user if available", alias="firstName")
|
|
36
|
+
last_name: Optional[StrictStr] = Field(default=None, description="Last Name of the user if available", alias="lastName")
|
|
37
|
+
role: Role
|
|
38
|
+
email: Optional[StrictStr] = Field(default=None, description="Email address of the user")
|
|
39
|
+
updated_on: datetime = Field(description="Timestamp of the last update to the user entry", alias="updatedOn")
|
|
40
|
+
created_on: datetime = Field(description="Timestamp of the creation of the user entry", alias="createdOn")
|
|
41
|
+
language: Optional[StrictStr] = Field(default=None, description="The preferred language of the user (shortened version, e.g. 'EN', 'NL')")
|
|
42
|
+
__properties: ClassVar[List[str]] = ["id", "firstName", "lastName", "role", "email", "updatedOn", "createdOn", "language"]
|
|
43
|
+
|
|
44
|
+
model_config = {
|
|
45
|
+
"populate_by_name": True,
|
|
46
|
+
"validate_assignment": True,
|
|
47
|
+
"protected_namespaces": (),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
58
|
+
return json.dumps(self.to_dict())
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> Self:
|
|
62
|
+
"""Create an instance of ReadUserMeDto from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
|
67
|
+
|
|
68
|
+
This has the following differences from calling pydantic's
|
|
69
|
+
`self.model_dump(by_alias=True)`:
|
|
70
|
+
|
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
|
72
|
+
were set at model initialization. Other fields with value `None`
|
|
73
|
+
are ignored.
|
|
74
|
+
"""
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude={
|
|
78
|
+
},
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# set to None if first_name (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.first_name is None and "first_name" in self.model_fields_set:
|
|
84
|
+
_dict['firstName'] = None
|
|
85
|
+
|
|
86
|
+
# set to None if last_name (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.last_name is None and "last_name" in self.model_fields_set:
|
|
89
|
+
_dict['lastName'] = None
|
|
90
|
+
|
|
91
|
+
# set to None if email (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.email is None and "email" in self.model_fields_set:
|
|
94
|
+
_dict['email'] = None
|
|
95
|
+
|
|
96
|
+
# set to None if language (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.language is None and "language" in self.model_fields_set:
|
|
99
|
+
_dict['language'] = None
|
|
100
|
+
|
|
101
|
+
return _dict
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
105
|
+
"""Create an instance of ReadUserMeDto from a dict"""
|
|
106
|
+
if obj is None:
|
|
107
|
+
return None
|
|
108
|
+
|
|
109
|
+
if not isinstance(obj, dict):
|
|
110
|
+
return cls.model_validate(obj)
|
|
111
|
+
|
|
112
|
+
_obj = cls.model_validate({
|
|
113
|
+
"id": obj.get("id"),
|
|
114
|
+
"firstName": obj.get("firstName"),
|
|
115
|
+
"lastName": obj.get("lastName"),
|
|
116
|
+
"role": obj.get("role"),
|
|
117
|
+
"email": obj.get("email"),
|
|
118
|
+
"updatedOn": obj.get("updatedOn"),
|
|
119
|
+
"createdOn": obj.get("createdOn"),
|
|
120
|
+
"language": obj.get("language")
|
|
121
|
+
})
|
|
122
|
+
return _obj
|
|
123
|
+
|
|
124
|
+
|
weheat/models/role.py
CHANGED
|
@@ -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 Role(int, Enum):
|
|
25
30
|
"""
|
|
26
|
-
Roles that can be assigned to a user.\\ Roles enumeration include: - Admin (0), - Support (1), -
|
|
31
|
+
Roles that can be assigned to a user.\\ Roles enumeration include: - Admin (0), - Support (1), - Factory (2), - Sales (3), - DataScientist (4), - ProductionObsoleteRole (5), - Installer (6), - Consumer (7) - Distributor (8)
|
|
27
32
|
"""
|
|
28
33
|
|
|
29
34
|
"""
|
|
@@ -37,10 +42,11 @@ class Role(int, Enum):
|
|
|
37
42
|
NUMBER_5 = 5
|
|
38
43
|
NUMBER_6 = 6
|
|
39
44
|
NUMBER_7 = 7
|
|
45
|
+
NUMBER_8 = 8
|
|
40
46
|
|
|
41
47
|
@classmethod
|
|
42
|
-
def from_json(cls, json_str: str) ->
|
|
48
|
+
def from_json(cls, json_str: str) -> Self:
|
|
43
49
|
"""Create an instance of Role from a JSON string"""
|
|
44
|
-
return
|
|
50
|
+
return cls(json.loads(json_str))
|
|
45
51
|
|
|
46
52
|
|
|
@@ -0,0 +1,111 @@
|
|
|
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, Union
|
|
22
|
+
from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr
|
|
23
|
+
from pydantic import Field
|
|
24
|
+
try:
|
|
25
|
+
from typing import Self
|
|
26
|
+
except ImportError:
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class TotalEnergyAggregate(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
TotalEnergyAggregate
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
heat_pump_id: Optional[StrictStr] = Field(default=None, alias="heatPumpId")
|
|
34
|
+
total_ein_heating: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEInHeating")
|
|
35
|
+
total_ein_standby: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEInStandby")
|
|
36
|
+
total_ein_dhw: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEInDhw")
|
|
37
|
+
total_ein_heating_defrost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEInHeatingDefrost")
|
|
38
|
+
total_ein_dhw_defrost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEInDhwDefrost")
|
|
39
|
+
total_ein_cooling: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEInCooling")
|
|
40
|
+
total_e_out_heating: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEOutHeating")
|
|
41
|
+
total_e_out_dhw: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEOutDhw")
|
|
42
|
+
total_e_out_heating_defrost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEOutHeatingDefrost")
|
|
43
|
+
total_e_out_dhw_defrost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEOutDhwDefrost")
|
|
44
|
+
total_e_out_cooling: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalEOutCooling")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["heatPumpId", "totalEInHeating", "totalEInStandby", "totalEInDhw", "totalEInHeatingDefrost", "totalEInDhwDefrost", "totalEInCooling", "totalEOutHeating", "totalEOutDhw", "totalEOutHeatingDefrost", "totalEOutDhwDefrost", "totalEOutCooling",]
|
|
46
|
+
|
|
47
|
+
model_config = {
|
|
48
|
+
"populate_by_name": True,
|
|
49
|
+
"validate_assignment": True,
|
|
50
|
+
"protected_namespaces": (),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Self:
|
|
65
|
+
"""Create an instance of TotalEnergyAggregate from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude={
|
|
81
|
+
},
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
88
|
+
"""Create an instance of TotalEnergyAggregate from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"heatPumpId": obj.get("heatPumpId"),
|
|
97
|
+
"totalEInHeating": obj.get("totalEInHeating"),
|
|
98
|
+
"totalEInStandby": obj.get("totalEInStandby"),
|
|
99
|
+
"totalEInDhw": obj.get("totalEInDhw"),
|
|
100
|
+
"totalEInHeatingDefrost": obj.get("totalEInHeatingDefrost"),
|
|
101
|
+
"totalEInDhwDefrost": obj.get("totalEInDhwDefrost"),
|
|
102
|
+
"totalEInCooling": obj.get("totalEInCooling"),
|
|
103
|
+
"totalEOutHeating": obj.get("totalEOutHeating"),
|
|
104
|
+
"totalEOutDhw": obj.get("totalEOutDhw"),
|
|
105
|
+
"totalEOutHeatingDefrost": obj.get("totalEOutHeatingDefrost"),
|
|
106
|
+
"totalEOutDhwDefrost": obj.get("totalEOutDhwDefrost"),
|
|
107
|
+
"totalEOutCooling": obj.get("totalEOutCooling")
|
|
108
|
+
})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|