weheat 2025.1.14__py3-none-any.whl → 2025.1.15rc1__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.
Potentially problematic release.
This version of weheat might be problematic. Click here for more details.
- weheat/__init__.py +7 -2
- weheat/abstractions/discovery.py +2 -4
- weheat/abstractions/heat_pump.py +6 -13
- weheat/abstractions/user.py +3 -5
- weheat/api/__init__.py +1 -0
- weheat/api/energy_log_api.py +306 -132
- weheat/api/heat_pump_api.py +521 -369
- weheat/api/heat_pump_log_api.py +836 -359
- weheat/api/user_api.py +243 -115
- weheat/api_client.py +234 -261
- weheat/api_response.py +10 -18
- weheat/configuration.py +4 -8
- weheat/exceptions.py +59 -25
- weheat/models/__init__.py +6 -0
- weheat/models/boiler_type.py +8 -3
- weheat/models/device_state.py +9 -4
- weheat/models/dhw_type.py +8 -3
- weheat/models/energy_view_dto.py +81 -66
- weheat/models/heat_pump_log_view_dto.py +527 -481
- weheat/models/heat_pump_model.py +8 -3
- weheat/models/heat_pump_status_enum.py +8 -3
- weheat/models/heat_pump_type.py +8 -3
- weheat/models/raw_heat_pump_log_dto.py +353 -315
- weheat/models/read_all_heat_pump_dto.py +64 -48
- weheat/models/read_heat_pump_dto.py +59 -43
- weheat/models/read_user_dto.py +54 -39
- weheat/models/read_user_me_dto.py +124 -0
- weheat/models/role.py +10 -4
- weheat/rest.py +142 -257
- weheat-2025.1.15rc1.dist-info/METADATA +115 -0
- weheat-2025.1.15rc1.dist-info/RECORD +37 -0
- weheat-2025.1.14.dist-info/METADATA +0 -117
- weheat-2025.1.14.dist-info/RECORD +0 -36
- {weheat-2025.1.14.dist-info → weheat-2025.1.15rc1.dist-info}/LICENSE +0 -0
- {weheat-2025.1.14.dist-info → weheat-2025.1.15rc1.dist-info}/WHEEL +0 -0
- {weheat-2025.1.14.dist-info → weheat-2025.1.15rc1.dist-info}/top_level.txt +0 -0
weheat/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "2024.
|
|
17
|
+
__version__ = "2024.11.15"
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from weheat.api.energy_log_api import EnergyLogApi
|
|
@@ -34,12 +34,17 @@ from weheat.exceptions import ApiAttributeError
|
|
|
34
34
|
from weheat.exceptions import ApiException
|
|
35
35
|
|
|
36
36
|
# import models into sdk package
|
|
37
|
+
from weheat.models.boiler_type import BoilerType
|
|
37
38
|
from weheat.models.device_state import DeviceState
|
|
39
|
+
from weheat.models.dhw_type import DhwType
|
|
38
40
|
from weheat.models.energy_view_dto import EnergyViewDto
|
|
39
41
|
from weheat.models.heat_pump_log_view_dto import HeatPumpLogViewDto
|
|
42
|
+
from weheat.models.heat_pump_model import HeatPumpModel
|
|
43
|
+
from weheat.models.heat_pump_status_enum import HeatPumpStatusEnum
|
|
44
|
+
from weheat.models.heat_pump_type import HeatPumpType
|
|
40
45
|
from weheat.models.raw_heat_pump_log_dto import RawHeatPumpLogDto
|
|
41
46
|
from weheat.models.read_all_heat_pump_dto import ReadAllHeatPumpDto
|
|
42
47
|
from weheat.models.read_heat_pump_dto import ReadHeatPumpDto
|
|
43
48
|
from weheat.models.read_user_dto import ReadUserDto
|
|
49
|
+
from weheat.models.read_user_me_dto import ReadUserMeDto
|
|
44
50
|
from weheat.models.role import Role
|
|
45
|
-
|
weheat/abstractions/discovery.py
CHANGED
|
@@ -22,11 +22,9 @@ class HeatPumpDiscovery:
|
|
|
22
22
|
|
|
23
23
|
config = Configuration(host=api_url, access_token=access_token)
|
|
24
24
|
|
|
25
|
-
with ApiClient(configuration=config) as client:
|
|
25
|
+
async with ApiClient(configuration=config) as client:
|
|
26
26
|
|
|
27
|
-
response = HeatPumpApi(client).api_v1_heat_pumps_get_with_http_info('', 1, 1000, DeviceState.NUMBER_3
|
|
28
|
-
|
|
29
|
-
response = await asyncio.to_thread(response.get)
|
|
27
|
+
response = await HeatPumpApi(client).api_v1_heat_pumps_get_with_http_info('', 1, 1000, DeviceState.NUMBER_3)
|
|
30
28
|
|
|
31
29
|
if response.status_code == 200:
|
|
32
30
|
for pump in response.data:
|
weheat/abstractions/heat_pump.py
CHANGED
|
@@ -39,36 +39,29 @@ class HeatPump:
|
|
|
39
39
|
try:
|
|
40
40
|
config = Configuration(host=self._api_url, access_token=access_token)
|
|
41
41
|
|
|
42
|
-
with ApiClient(configuration=config) as client:
|
|
42
|
+
async with ApiClient(configuration=config) as client:
|
|
43
43
|
# Set the max power once
|
|
44
44
|
if self._nominal_max_power is None:
|
|
45
|
-
response = HeatPumpApi(client).api_v1_heat_pumps_heat_pump_id_get_with_http_info(heat_pump_id=self._uuid
|
|
46
|
-
|
|
47
|
-
response = await asyncio.to_thread(response.get)
|
|
45
|
+
response = await HeatPumpApi(client).api_v1_heat_pumps_heat_pump_id_get_with_http_info(heat_pump_id=self._uuid)
|
|
48
46
|
|
|
49
47
|
if response.status_code == 200:
|
|
50
48
|
self._set_nominal_max_power_for_model(response.data.model)
|
|
51
49
|
|
|
52
50
|
|
|
53
|
-
response = HeatPumpLogApi(
|
|
51
|
+
response = await HeatPumpLogApi(
|
|
54
52
|
client
|
|
55
53
|
).api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(
|
|
56
|
-
heat_pump_id=self._uuid
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
response = await asyncio.to_thread(response.get)
|
|
54
|
+
heat_pump_id=self._uuid )
|
|
60
55
|
|
|
61
56
|
if response.status_code == 200:
|
|
62
57
|
self._last_log = response.data
|
|
63
58
|
|
|
64
59
|
# Also get all energy totals form past years and add them together
|
|
65
60
|
# As end time pick today + 1 day to avoid issues with timezones
|
|
66
|
-
response = EnergyLogApi(client).api_v1_energy_logs_heat_pump_id_get_with_http_info(heat_pump_id=self._uuid,
|
|
61
|
+
response = await EnergyLogApi(client).api_v1_energy_logs_heat_pump_id_get_with_http_info(heat_pump_id=self._uuid,
|
|
67
62
|
start_time=START_DATE,
|
|
68
63
|
end_time=datetime.now() + timedelta(days=1),
|
|
69
|
-
interval='Month'
|
|
70
|
-
|
|
71
|
-
response = await asyncio.to_thread(response.get)
|
|
64
|
+
interval='Month')
|
|
72
65
|
|
|
73
66
|
if response.status_code == 200:
|
|
74
67
|
# aggregate the energy consumption
|
weheat/abstractions/user.py
CHANGED
|
@@ -10,12 +10,10 @@ async def async_get_user_id_from_token(api_url: str, access_token: str):
|
|
|
10
10
|
try:
|
|
11
11
|
config = Configuration(host=api_url, access_token=access_token)
|
|
12
12
|
|
|
13
|
-
with ApiClient(configuration=config) as client:
|
|
14
|
-
response = UserApi(
|
|
13
|
+
async with ApiClient(configuration=config) as client:
|
|
14
|
+
response = await UserApi(
|
|
15
15
|
client
|
|
16
|
-
).api_v1_users_me_get_with_http_info(
|
|
17
|
-
|
|
18
|
-
response = await asyncio.to_thread(response.get)
|
|
16
|
+
).api_v1_users_me_get_with_http_info()
|
|
19
17
|
|
|
20
18
|
if response.status_code == 200:
|
|
21
19
|
return response.data.id
|
weheat/api/__init__.py
CHANGED
weheat/api/energy_log_api.py
CHANGED
|
@@ -12,29 +12,30 @@
|
|
|
12
12
|
""" # noqa: E501
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
import re # noqa: F401
|
|
16
15
|
import io
|
|
17
16
|
import warnings
|
|
18
17
|
|
|
18
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
19
|
+
from typing import Dict, List, Optional, Tuple, Union, Any
|
|
20
|
+
|
|
19
21
|
try:
|
|
20
|
-
from
|
|
22
|
+
from typing import Annotated
|
|
21
23
|
except ImportError:
|
|
22
|
-
from
|
|
23
|
-
|
|
24
|
+
from typing_extensions import Annotated
|
|
24
25
|
|
|
26
|
+
from pydantic import Field
|
|
25
27
|
from typing_extensions import Annotated
|
|
26
28
|
from datetime import datetime
|
|
27
29
|
|
|
30
|
+
from pydantic import StrictStr
|
|
31
|
+
|
|
28
32
|
from typing import List, Optional
|
|
29
33
|
|
|
30
34
|
from weheat.models.energy_view_dto import EnergyViewDto
|
|
31
35
|
|
|
32
36
|
from weheat.api_client import ApiClient
|
|
33
37
|
from weheat.api_response import ApiResponse
|
|
34
|
-
from weheat.
|
|
35
|
-
ApiTypeError,
|
|
36
|
-
ApiValueError
|
|
37
|
-
)
|
|
38
|
+
from weheat.rest import RESTResponseType
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
class EnergyLogApi:
|
|
@@ -49,15 +50,30 @@ class EnergyLogApi:
|
|
|
49
50
|
api_client = ApiClient.get_default()
|
|
50
51
|
self.api_client = api_client
|
|
51
52
|
|
|
52
|
-
@validate_arguments
|
|
53
|
-
def api_v1_energy_logs_heat_pump_id_get(self, heat_pump_id : Annotated[StrictStr, Field(..., description="The id of the heat pump")], start_time : Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, end_time : Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None, interval : Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None, x_version : Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None, **kwargs) -> List[EnergyViewDto]: # noqa: E501
|
|
54
|
-
"""Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals # noqa: E501
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
@validate_call
|
|
55
|
+
async def api_v1_energy_logs_heat_pump_id_get(
|
|
56
|
+
self,
|
|
57
|
+
heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
|
|
58
|
+
start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
|
|
59
|
+
end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
|
|
60
|
+
interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
|
|
61
|
+
x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
|
|
62
|
+
_request_timeout: Union[
|
|
63
|
+
None,
|
|
64
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
65
|
+
Tuple[
|
|
66
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
67
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
68
|
+
]
|
|
69
|
+
] = None,
|
|
70
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
71
|
+
_content_type: Optional[StrictStr] = None,
|
|
72
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
73
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
74
|
+
) -> List[EnergyViewDto]:
|
|
75
|
+
"""Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals
|
|
58
76
|
|
|
59
|
-
>>> thread = api.api_v1_energy_logs_heat_pump_id_get(heat_pump_id, start_time, end_time, interval, x_version, async_req=True)
|
|
60
|
-
>>> result = thread.get()
|
|
61
77
|
|
|
62
78
|
:param heat_pump_id: The id of the heat pump (required)
|
|
63
79
|
:type heat_pump_id: str
|
|
@@ -69,32 +85,81 @@ class EnergyLogApi:
|
|
|
69
85
|
:type interval: str
|
|
70
86
|
:param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
|
|
71
87
|
:type x_version: str
|
|
72
|
-
:param
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
89
|
+
number provided, it will be total request
|
|
90
|
+
timeout. It can also be a pair (tuple) of
|
|
91
|
+
(connection, read) timeouts.
|
|
92
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
93
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
94
|
+
request; this effectively ignores the
|
|
95
|
+
authentication in the spec for a single request.
|
|
96
|
+
:type _request_auth: dict, optional
|
|
97
|
+
:param _content_type: force content-type for the request.
|
|
98
|
+
:type _content_type: str, Optional
|
|
99
|
+
:param _headers: set to override the headers for a single
|
|
100
|
+
request; this effectively ignores the headers
|
|
101
|
+
in the spec for a single request.
|
|
102
|
+
:type _headers: dict, optional
|
|
103
|
+
:param _host_index: set to override the host_index for a single
|
|
104
|
+
request; this effectively ignores the host_index
|
|
105
|
+
in the spec for a single request.
|
|
106
|
+
:type _host_index: int, optional
|
|
78
107
|
:return: Returns the result object.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
""" # noqa: E501
|
|
109
|
+
|
|
110
|
+
_param = self._api_v1_energy_logs_heat_pump_id_get_serialize(
|
|
111
|
+
heat_pump_id=heat_pump_id,
|
|
112
|
+
start_time=start_time,
|
|
113
|
+
end_time=end_time,
|
|
114
|
+
interval=interval,
|
|
115
|
+
x_version=x_version,
|
|
116
|
+
_request_auth=_request_auth,
|
|
117
|
+
_content_type=_content_type,
|
|
118
|
+
_headers=_headers,
|
|
119
|
+
_host_index=_host_index
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
123
|
+
'403': "str",
|
|
124
|
+
'500': None,
|
|
125
|
+
'505': None,
|
|
126
|
+
'200': "List[EnergyViewDto]",
|
|
127
|
+
'400': None,
|
|
128
|
+
}
|
|
129
|
+
response_data = await self.api_client.call_api(
|
|
130
|
+
*_param,
|
|
131
|
+
_request_timeout=_request_timeout
|
|
132
|
+
)
|
|
133
|
+
await response_data.read()
|
|
134
|
+
return self.api_client.response_deserialize(
|
|
135
|
+
response_data=response_data,
|
|
136
|
+
response_types_map=_response_types_map,
|
|
137
|
+
).data
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
@validate_call
|
|
141
|
+
async def api_v1_energy_logs_heat_pump_id_get_with_http_info(
|
|
142
|
+
self,
|
|
143
|
+
heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
|
|
144
|
+
start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
|
|
145
|
+
end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
|
|
146
|
+
interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
|
|
147
|
+
x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
|
|
148
|
+
_request_timeout: Union[
|
|
149
|
+
None,
|
|
150
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
151
|
+
Tuple[
|
|
152
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
153
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
154
|
+
]
|
|
155
|
+
] = None,
|
|
156
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
157
|
+
_content_type: Optional[StrictStr] = None,
|
|
158
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
159
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
160
|
+
) -> ApiResponse[List[EnergyViewDto]]:
|
|
161
|
+
"""Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals
|
|
162
|
+
|
|
98
163
|
|
|
99
164
|
:param heat_pump_id: The id of the heat pump (required)
|
|
100
165
|
:type heat_pump_id: str
|
|
@@ -106,125 +171,234 @@ class EnergyLogApi:
|
|
|
106
171
|
:type interval: str
|
|
107
172
|
:param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
|
|
108
173
|
:type x_version: str
|
|
109
|
-
:param async_req: Whether to execute the request asynchronously.
|
|
110
|
-
:type async_req: bool, optional
|
|
111
|
-
:param _preload_content: if False, the ApiResponse.data will
|
|
112
|
-
be set to none and raw_data will store the
|
|
113
|
-
HTTP response body without reading/decoding.
|
|
114
|
-
Default is True.
|
|
115
|
-
:type _preload_content: bool, optional
|
|
116
|
-
:param _return_http_data_only: response data instead of ApiResponse
|
|
117
|
-
object with status code, headers, etc
|
|
118
|
-
:type _return_http_data_only: bool, optional
|
|
119
174
|
:param _request_timeout: timeout setting for this request. If one
|
|
120
175
|
number provided, it will be total request
|
|
121
176
|
timeout. It can also be a pair (tuple) of
|
|
122
177
|
(connection, read) timeouts.
|
|
178
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
123
179
|
:param _request_auth: set to override the auth_settings for an a single
|
|
124
|
-
request; this effectively ignores the
|
|
125
|
-
in the spec for a single request.
|
|
180
|
+
request; this effectively ignores the
|
|
181
|
+
authentication in the spec for a single request.
|
|
126
182
|
:type _request_auth: dict, optional
|
|
127
|
-
:
|
|
183
|
+
:param _content_type: force content-type for the request.
|
|
184
|
+
:type _content_type: str, Optional
|
|
185
|
+
:param _headers: set to override the headers for a single
|
|
186
|
+
request; this effectively ignores the headers
|
|
187
|
+
in the spec for a single request.
|
|
188
|
+
:type _headers: dict, optional
|
|
189
|
+
:param _host_index: set to override the host_index for a single
|
|
190
|
+
request; this effectively ignores the host_index
|
|
191
|
+
in the spec for a single request.
|
|
192
|
+
:type _host_index: int, optional
|
|
128
193
|
:return: Returns the result object.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
194
|
+
""" # noqa: E501
|
|
195
|
+
|
|
196
|
+
_param = self._api_v1_energy_logs_heat_pump_id_get_serialize(
|
|
197
|
+
heat_pump_id=heat_pump_id,
|
|
198
|
+
start_time=start_time,
|
|
199
|
+
end_time=end_time,
|
|
200
|
+
interval=interval,
|
|
201
|
+
x_version=x_version,
|
|
202
|
+
_request_auth=_request_auth,
|
|
203
|
+
_content_type=_content_type,
|
|
204
|
+
_headers=_headers,
|
|
205
|
+
_host_index=_host_index
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
209
|
+
'403': "str",
|
|
210
|
+
'500': None,
|
|
211
|
+
'505': None,
|
|
212
|
+
'200': "List[EnergyViewDto]",
|
|
213
|
+
'400': None,
|
|
214
|
+
}
|
|
215
|
+
response_data = await self.api_client.call_api(
|
|
216
|
+
*_param,
|
|
217
|
+
_request_timeout=_request_timeout
|
|
218
|
+
)
|
|
219
|
+
await response_data.read()
|
|
220
|
+
return self.api_client.response_deserialize(
|
|
221
|
+
response_data=response_data,
|
|
222
|
+
response_types_map=_response_types_map,
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
@validate_call
|
|
227
|
+
async def api_v1_energy_logs_heat_pump_id_get_without_preload_content(
|
|
228
|
+
self,
|
|
229
|
+
heat_pump_id: Annotated[StrictStr, Field(description="The id of the heat pump")],
|
|
230
|
+
start_time: Annotated[Optional[datetime], Field(description="Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
|
|
231
|
+
end_time: Annotated[Optional[datetime], Field(description="End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)")] = None,
|
|
232
|
+
interval: Annotated[Optional[StrictStr], Field(description="Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"")] = None,
|
|
233
|
+
x_version: Annotated[Optional[StrictStr], Field(description="Optional version parameter for frontend applications to check if an update / refresh is needed")] = None,
|
|
234
|
+
_request_timeout: Union[
|
|
235
|
+
None,
|
|
236
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
237
|
+
Tuple[
|
|
238
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
239
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
152
240
|
]
|
|
241
|
+
] = None,
|
|
242
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
243
|
+
_content_type: Optional[StrictStr] = None,
|
|
244
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
245
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
246
|
+
) -> RESTResponseType:
|
|
247
|
+
"""Gets the energy logs of the heat pump in a from start time to end time for a given interval Correct Intervals include: Hour, Day, Week, Month, Year Hour logs are rounded to 3 decimals, other logs to 2 decimals
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
:param heat_pump_id: The id of the heat pump (required)
|
|
251
|
+
:type heat_pump_id: str
|
|
252
|
+
:param start_time: Start time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
|
|
253
|
+
:type start_time: datetime
|
|
254
|
+
:param end_time: End time of the interval as a DateTime object in UTC (format: yyyy-MM-dd HH:mm:ss)
|
|
255
|
+
:type end_time: datetime
|
|
256
|
+
:param interval: Interval granularity of the log data, allowed intervals: \"Hour\", \"Day\", \"Week\", \"Month\", \"Year\"
|
|
257
|
+
:type interval: str
|
|
258
|
+
:param x_version: Optional version parameter for frontend applications to check if an update / refresh is needed
|
|
259
|
+
:type x_version: str
|
|
260
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
261
|
+
number provided, it will be total request
|
|
262
|
+
timeout. It can also be a pair (tuple) of
|
|
263
|
+
(connection, read) timeouts.
|
|
264
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
265
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
266
|
+
request; this effectively ignores the
|
|
267
|
+
authentication in the spec for a single request.
|
|
268
|
+
:type _request_auth: dict, optional
|
|
269
|
+
:param _content_type: force content-type for the request.
|
|
270
|
+
:type _content_type: str, Optional
|
|
271
|
+
:param _headers: set to override the headers for a single
|
|
272
|
+
request; this effectively ignores the headers
|
|
273
|
+
in the spec for a single request.
|
|
274
|
+
:type _headers: dict, optional
|
|
275
|
+
:param _host_index: set to override the host_index for a single
|
|
276
|
+
request; this effectively ignores the host_index
|
|
277
|
+
in the spec for a single request.
|
|
278
|
+
:type _host_index: int, optional
|
|
279
|
+
:return: Returns the result object.
|
|
280
|
+
""" # noqa: E501
|
|
281
|
+
|
|
282
|
+
_param = self._api_v1_energy_logs_heat_pump_id_get_serialize(
|
|
283
|
+
heat_pump_id=heat_pump_id,
|
|
284
|
+
start_time=start_time,
|
|
285
|
+
end_time=end_time,
|
|
286
|
+
interval=interval,
|
|
287
|
+
x_version=x_version,
|
|
288
|
+
_request_auth=_request_auth,
|
|
289
|
+
_content_type=_content_type,
|
|
290
|
+
_headers=_headers,
|
|
291
|
+
_host_index=_host_index
|
|
153
292
|
)
|
|
154
293
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
294
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
295
|
+
'403': "str",
|
|
296
|
+
'500': None,
|
|
297
|
+
'505': None,
|
|
298
|
+
'200': "List[EnergyViewDto]",
|
|
299
|
+
'400': None,
|
|
300
|
+
}
|
|
301
|
+
response_data = await self.api_client.call_api(
|
|
302
|
+
*_param,
|
|
303
|
+
_request_timeout=_request_timeout
|
|
304
|
+
)
|
|
305
|
+
return response_data.response
|
|
164
306
|
|
|
165
|
-
_collection_formats = {}
|
|
166
307
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
308
|
+
def _api_v1_energy_logs_heat_pump_id_get_serialize(
|
|
309
|
+
self,
|
|
310
|
+
heat_pump_id,
|
|
311
|
+
start_time,
|
|
312
|
+
end_time,
|
|
313
|
+
interval,
|
|
314
|
+
x_version,
|
|
315
|
+
_request_auth,
|
|
316
|
+
_content_type,
|
|
317
|
+
_headers,
|
|
318
|
+
_host_index,
|
|
319
|
+
) -> Tuple:
|
|
171
320
|
|
|
321
|
+
_host = None
|
|
172
322
|
|
|
323
|
+
_collection_formats: Dict[str, str] = {
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
_path_params: Dict[str, str] = {}
|
|
327
|
+
_query_params: List[Tuple[str, str]] = []
|
|
328
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
329
|
+
_form_params: List[Tuple[str, str]] = []
|
|
330
|
+
_files: Dict[str, str] = {}
|
|
331
|
+
_body_params: Optional[bytes] = None
|
|
332
|
+
|
|
333
|
+
# process the path parameters
|
|
334
|
+
if heat_pump_id is not None:
|
|
335
|
+
_path_params['heatPumpId'] = heat_pump_id
|
|
173
336
|
# process the query parameters
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
337
|
+
if start_time is not None:
|
|
338
|
+
if isinstance(start_time, datetime):
|
|
339
|
+
_query_params.append(
|
|
340
|
+
(
|
|
341
|
+
'startTime',
|
|
342
|
+
start_time.strftime(
|
|
343
|
+
self.api_client.configuration.datetime_format
|
|
344
|
+
)
|
|
345
|
+
)
|
|
346
|
+
)
|
|
178
347
|
else:
|
|
179
|
-
_query_params.append(('startTime',
|
|
180
|
-
|
|
181
|
-
if
|
|
182
|
-
if isinstance(
|
|
183
|
-
_query_params.append(
|
|
348
|
+
_query_params.append(('startTime', start_time))
|
|
349
|
+
|
|
350
|
+
if end_time is not None:
|
|
351
|
+
if isinstance(end_time, datetime):
|
|
352
|
+
_query_params.append(
|
|
353
|
+
(
|
|
354
|
+
'endTime',
|
|
355
|
+
end_time.strftime(
|
|
356
|
+
self.api_client.configuration.datetime_format
|
|
357
|
+
)
|
|
358
|
+
)
|
|
359
|
+
)
|
|
184
360
|
else:
|
|
185
|
-
_query_params.append(('endTime',
|
|
186
|
-
|
|
187
|
-
if
|
|
188
|
-
|
|
189
|
-
|
|
361
|
+
_query_params.append(('endTime', end_time))
|
|
362
|
+
|
|
363
|
+
if interval is not None:
|
|
364
|
+
|
|
365
|
+
_query_params.append(('interval', interval))
|
|
366
|
+
|
|
190
367
|
# process the header parameters
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
_header_params['x-version'] = _params['x_version']
|
|
194
|
-
|
|
368
|
+
if x_version is not None:
|
|
369
|
+
_header_params['x-version'] = x_version
|
|
195
370
|
# process the form parameters
|
|
196
|
-
_form_params = []
|
|
197
|
-
_files = {}
|
|
198
371
|
# process the body parameter
|
|
199
|
-
|
|
372
|
+
|
|
373
|
+
|
|
200
374
|
# set the HTTP header `Accept`
|
|
201
375
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
202
|
-
[
|
|
376
|
+
[
|
|
377
|
+
'text/plain',
|
|
378
|
+
'application/json',
|
|
379
|
+
'text/json'
|
|
380
|
+
]
|
|
381
|
+
)
|
|
203
382
|
|
|
204
|
-
# authentication setting
|
|
205
|
-
_auth_settings = ['oauth2'] # noqa: E501
|
|
206
383
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
'
|
|
210
|
-
|
|
211
|
-
'400': None,
|
|
212
|
-
'500': None,
|
|
213
|
-
}
|
|
384
|
+
# authentication setting
|
|
385
|
+
_auth_settings: List[str] = [
|
|
386
|
+
'oauth2'
|
|
387
|
+
]
|
|
214
388
|
|
|
215
|
-
return self.api_client.
|
|
216
|
-
'
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
389
|
+
return self.api_client.param_serialize(
|
|
390
|
+
method='GET',
|
|
391
|
+
resource_path='/api/v1/energy-logs/{heatPumpId}',
|
|
392
|
+
path_params=_path_params,
|
|
393
|
+
query_params=_query_params,
|
|
394
|
+
header_params=_header_params,
|
|
220
395
|
body=_body_params,
|
|
221
396
|
post_params=_form_params,
|
|
222
397
|
files=_files,
|
|
223
|
-
response_types_map=_response_types_map,
|
|
224
398
|
auth_settings=_auth_settings,
|
|
225
|
-
async_req=_params.get('async_req'),
|
|
226
|
-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
|
227
|
-
_preload_content=_params.get('_preload_content', True),
|
|
228
|
-
_request_timeout=_params.get('_request_timeout'),
|
|
229
399
|
collection_formats=_collection_formats,
|
|
230
|
-
|
|
400
|
+
_host=_host,
|
|
401
|
+
_request_auth=_request_auth
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
|