weheat 2025.1.14__tar.gz → 2025.1.15rc1__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.
Potentially problematic release.
This version of weheat might be problematic. Click here for more details.
- weheat-2025.1.15rc1/PKG-INFO +115 -0
- weheat-2025.1.15rc1/README.md +88 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/pyproject.toml +5 -3
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/setup.cfg +0 -3
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/setup.py +6 -5
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/__init__.py +7 -2
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/abstractions/discovery.py +2 -4
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/abstractions/heat_pump.py +6 -13
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/abstractions/user.py +3 -5
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/api/__init__.py +1 -0
- weheat-2025.1.15rc1/weheat/api/energy_log_api.py +404 -0
- weheat-2025.1.15rc1/weheat/api/heat_pump_api.py +684 -0
- weheat-2025.1.15rc1/weheat/api/heat_pump_log_api.py +1031 -0
- weheat-2025.1.15rc1/weheat/api/user_api.py +321 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/api_client.py +234 -261
- weheat-2025.1.15rc1/weheat/api_response.py +21 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/configuration.py +4 -8
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/exceptions.py +59 -25
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/__init__.py +6 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/boiler_type.py +8 -3
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/device_state.py +9 -4
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/dhw_type.py +8 -3
- weheat-2025.1.15rc1/weheat/models/energy_view_dto.py +136 -0
- weheat-2025.1.15rc1/weheat/models/heat_pump_log_view_dto.py +817 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/heat_pump_model.py +8 -3
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/heat_pump_status_enum.py +8 -3
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/heat_pump_type.py +8 -3
- weheat-2025.1.15rc1/weheat/models/raw_heat_pump_log_dto.py +555 -0
- weheat-2025.1.15rc1/weheat/models/read_all_heat_pump_dto.py +140 -0
- weheat-2025.1.15rc1/weheat/models/read_heat_pump_dto.py +133 -0
- weheat-2025.1.15rc1/weheat/models/read_user_dto.py +117 -0
- weheat-2025.1.15rc1/weheat/models/read_user_me_dto.py +124 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/models/role.py +10 -4
- weheat-2025.1.15rc1/weheat/rest.py +212 -0
- weheat-2025.1.15rc1/weheat.egg-info/PKG-INFO +115 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat.egg-info/SOURCES.txt +1 -0
- weheat-2025.1.15rc1/weheat.egg-info/requires.txt +6 -0
- weheat-2025.1.14/PKG-INFO +0 -117
- weheat-2025.1.14/README.md +0 -91
- weheat-2025.1.14/weheat/api/energy_log_api.py +0 -230
- weheat-2025.1.14/weheat/api/heat_pump_api.py +0 -532
- weheat-2025.1.14/weheat/api/heat_pump_log_api.py +0 -554
- weheat-2025.1.14/weheat/api/user_api.py +0 -193
- weheat-2025.1.14/weheat/api_response.py +0 -29
- weheat-2025.1.14/weheat/models/energy_view_dto.py +0 -121
- weheat-2025.1.14/weheat/models/heat_pump_log_view_dto.py +0 -771
- weheat-2025.1.14/weheat/models/raw_heat_pump_log_dto.py +0 -517
- weheat-2025.1.14/weheat/models/read_all_heat_pump_dto.py +0 -124
- weheat-2025.1.14/weheat/models/read_heat_pump_dto.py +0 -117
- weheat-2025.1.14/weheat/models/read_user_dto.py +0 -102
- weheat-2025.1.14/weheat/rest.py +0 -327
- weheat-2025.1.14/weheat.egg-info/PKG-INFO +0 -117
- weheat-2025.1.14/weheat.egg-info/requires.txt +0 -5
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/LICENSE +0 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/tests/test_ha_api.py +0 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/abstractions/__init__.py +0 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/abstractions/auth.py +0 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat/py.typed +0 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat.egg-info/dependency_links.txt +0 -0
- {weheat-2025.1.14 → weheat-2025.1.15rc1}/weheat.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: weheat
|
|
3
|
+
Version: 2025.1.15rc1
|
|
4
|
+
Summary: Weheat Backend client
|
|
5
|
+
Home-page: https://github.com/wefabricate/wh-python
|
|
6
|
+
Author: Jesper Raemaekers
|
|
7
|
+
Author-email: jesper.raemaekers@wefabricate.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: OpenAPI,OpenAPI-Generator,Weheat Backend
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: urllib3<2.1.0,>=1.25.3
|
|
13
|
+
Requires-Dist: python-dateutil
|
|
14
|
+
Requires-Dist: aiohttp>=3.0.0
|
|
15
|
+
Requires-Dist: aiohttp-retry>=2.8.3
|
|
16
|
+
Requires-Dist: pydantic>=2
|
|
17
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
18
|
+
Dynamic: author
|
|
19
|
+
Dynamic: author-email
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: keywords
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: summary
|
|
27
|
+
|
|
28
|
+
# Weheat backend client
|
|
29
|
+
|
|
30
|
+
This is a client for the Weheat backend. It is automatically generated from the OpenAPI specification.
|
|
31
|
+
|
|
32
|
+
## Requirements.
|
|
33
|
+
|
|
34
|
+
Python 3.7+
|
|
35
|
+
|
|
36
|
+
## Installation & Usage
|
|
37
|
+
|
|
38
|
+
You can install directly using:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
pip install weheat
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then import the package:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import weheat
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Getting Started
|
|
53
|
+
|
|
54
|
+
After installation, you can now use the client to interact with the Weheat backend. Note that all methods are async as of version 2025.1.15.
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import asyncio
|
|
58
|
+
import datetime
|
|
59
|
+
from keycloak import KeycloakOpenID # install with pip install python-keycloak
|
|
60
|
+
from weheat import ApiClient, Configuration, HeatPumpApi, HeatPumpLogApi, EnergyLogApi, UserApi
|
|
61
|
+
|
|
62
|
+
auth_url = 'https://auth.weheat.nl/auth/'
|
|
63
|
+
api_url = 'https://api.weheat.nl'
|
|
64
|
+
realm_name = 'Weheat'
|
|
65
|
+
my_client_id = 'WeheatCommunityAPI' # client ID and secret provided by Weheat
|
|
66
|
+
my_client_secret = ''
|
|
67
|
+
username = '' # username and password used for the online portal
|
|
68
|
+
password = ''
|
|
69
|
+
my_heat_pump_id = '' # your heat pump UUID
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
async def demo():
|
|
73
|
+
keycloak_open_id = KeycloakOpenID(server_url=auth_url,
|
|
74
|
+
client_id=my_client_id,
|
|
75
|
+
realm_name=realm_name,
|
|
76
|
+
client_secret_key=my_client_secret)
|
|
77
|
+
|
|
78
|
+
token_response = keycloak_open_id.token(username, password)
|
|
79
|
+
keycloak_open_id.logout(token_response['refresh_token'])
|
|
80
|
+
|
|
81
|
+
config = Configuration(host=api_url, access_token=token_response['access_token'])
|
|
82
|
+
async with ApiClient(configuration=config) as client:
|
|
83
|
+
response = await UserApi(client).api_v1_users_me_get_with_http_info()
|
|
84
|
+
|
|
85
|
+
if response.status_code == 200:
|
|
86
|
+
print(f'My user: {response.data}')
|
|
87
|
+
|
|
88
|
+
response = await HeatPumpApi(client).api_v1_heat_pumps_get_with_http_info()
|
|
89
|
+
|
|
90
|
+
if response.status_code == 200:
|
|
91
|
+
print(f'My heat pump: {response.data}')
|
|
92
|
+
|
|
93
|
+
response = await HeatPumpLogApi(client).api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(
|
|
94
|
+
heat_pump_id=my_heat_pump_id)
|
|
95
|
+
|
|
96
|
+
if response.status_code == 200:
|
|
97
|
+
print(f'My heat pump logs: {response.data}')
|
|
98
|
+
|
|
99
|
+
response = await EnergyLogApi(client).api_v1_energy_logs_heat_pump_id_get_with_http_info(heat_pump_id=my_heat_pump_id,
|
|
100
|
+
start_time=datetime.datetime(2024, 6,
|
|
101
|
+
22, 0, 0,
|
|
102
|
+
0),
|
|
103
|
+
end_time=datetime.datetime(2024, 6, 22,
|
|
104
|
+
15, 0, 0),
|
|
105
|
+
interval='Hour')
|
|
106
|
+
|
|
107
|
+
if response.status_code == 200:
|
|
108
|
+
print(f'My energy logs: {response.data}')
|
|
109
|
+
|
|
110
|
+
asyncio.get_event_loop().run_until_complete(demo())
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Weheat backend client
|
|
2
|
+
|
|
3
|
+
This is a client for the Weheat backend. It is automatically generated from the OpenAPI specification.
|
|
4
|
+
|
|
5
|
+
## Requirements.
|
|
6
|
+
|
|
7
|
+
Python 3.7+
|
|
8
|
+
|
|
9
|
+
## Installation & Usage
|
|
10
|
+
|
|
11
|
+
You can install directly using:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pip install weheat
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then import the package:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
import weheat
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Getting Started
|
|
26
|
+
|
|
27
|
+
After installation, you can now use the client to interact with the Weheat backend. Note that all methods are async as of version 2025.1.15.
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
import asyncio
|
|
31
|
+
import datetime
|
|
32
|
+
from keycloak import KeycloakOpenID # install with pip install python-keycloak
|
|
33
|
+
from weheat import ApiClient, Configuration, HeatPumpApi, HeatPumpLogApi, EnergyLogApi, UserApi
|
|
34
|
+
|
|
35
|
+
auth_url = 'https://auth.weheat.nl/auth/'
|
|
36
|
+
api_url = 'https://api.weheat.nl'
|
|
37
|
+
realm_name = 'Weheat'
|
|
38
|
+
my_client_id = 'WeheatCommunityAPI' # client ID and secret provided by Weheat
|
|
39
|
+
my_client_secret = ''
|
|
40
|
+
username = '' # username and password used for the online portal
|
|
41
|
+
password = ''
|
|
42
|
+
my_heat_pump_id = '' # your heat pump UUID
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
async def demo():
|
|
46
|
+
keycloak_open_id = KeycloakOpenID(server_url=auth_url,
|
|
47
|
+
client_id=my_client_id,
|
|
48
|
+
realm_name=realm_name,
|
|
49
|
+
client_secret_key=my_client_secret)
|
|
50
|
+
|
|
51
|
+
token_response = keycloak_open_id.token(username, password)
|
|
52
|
+
keycloak_open_id.logout(token_response['refresh_token'])
|
|
53
|
+
|
|
54
|
+
config = Configuration(host=api_url, access_token=token_response['access_token'])
|
|
55
|
+
async with ApiClient(configuration=config) as client:
|
|
56
|
+
response = await UserApi(client).api_v1_users_me_get_with_http_info()
|
|
57
|
+
|
|
58
|
+
if response.status_code == 200:
|
|
59
|
+
print(f'My user: {response.data}')
|
|
60
|
+
|
|
61
|
+
response = await HeatPumpApi(client).api_v1_heat_pumps_get_with_http_info()
|
|
62
|
+
|
|
63
|
+
if response.status_code == 200:
|
|
64
|
+
print(f'My heat pump: {response.data}')
|
|
65
|
+
|
|
66
|
+
response = await HeatPumpLogApi(client).api_v1_heat_pumps_heat_pump_id_logs_latest_get_with_http_info(
|
|
67
|
+
heat_pump_id=my_heat_pump_id)
|
|
68
|
+
|
|
69
|
+
if response.status_code == 200:
|
|
70
|
+
print(f'My heat pump logs: {response.data}')
|
|
71
|
+
|
|
72
|
+
response = await EnergyLogApi(client).api_v1_energy_logs_heat_pump_id_get_with_http_info(heat_pump_id=my_heat_pump_id,
|
|
73
|
+
start_time=datetime.datetime(2024, 6,
|
|
74
|
+
22, 0, 0,
|
|
75
|
+
0),
|
|
76
|
+
end_time=datetime.datetime(2024, 6, 22,
|
|
77
|
+
15, 0, 0),
|
|
78
|
+
interval='Hour')
|
|
79
|
+
|
|
80
|
+
if response.status_code == 200:
|
|
81
|
+
print(f'My energy logs: {response.data}')
|
|
82
|
+
|
|
83
|
+
asyncio.get_event_loop().run_until_complete(demo())
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "weheat"
|
|
3
|
-
version = "2025.1.
|
|
3
|
+
version = "2025.1.15rc1"
|
|
4
4
|
description = "Weheat Backend"
|
|
5
5
|
authors = ["Jesper Raemaekers <jesper.raemaekers@wefabricate.com>", "Kjell van Straaten <kjell.van.straaten@wefabricate.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -14,8 +14,10 @@ python = "^3.7"
|
|
|
14
14
|
|
|
15
15
|
urllib3 = ">= 1.25.3"
|
|
16
16
|
python-dateutil = ">=2.8.2"
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
aiohttp = ">= 3.8.4"
|
|
18
|
+
aiohttp-retry = ">= 2.8.3"
|
|
19
|
+
pydantic = ">=2"
|
|
20
|
+
typing-extensions = ">=4.7.1"
|
|
19
21
|
|
|
20
22
|
[tool.poetry.dev-dependencies]
|
|
21
23
|
pytest = ">=7.2.1"
|
|
@@ -21,14 +21,15 @@ from setuptools import setup, find_packages # noqa: H301
|
|
|
21
21
|
# prerequisite: setuptools
|
|
22
22
|
# http://pypi.python.org/pypi/setuptools
|
|
23
23
|
NAME = "weheat"
|
|
24
|
-
VERSION = "2025.1.
|
|
24
|
+
VERSION = "2025.1.15rc1"
|
|
25
25
|
PYTHON_REQUIRES = ">=3.7"
|
|
26
26
|
REQUIRES = [
|
|
27
27
|
"urllib3 >= 1.25.3, < 2.1.0",
|
|
28
28
|
"python-dateutil",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
29
|
+
"aiohttp >= 3.0.0",
|
|
30
|
+
"aiohttp-retry >= 2.8.3",
|
|
31
|
+
"pydantic >= 2",
|
|
32
|
+
"typing-extensions >= 4.7.1",
|
|
32
33
|
]
|
|
33
34
|
|
|
34
35
|
setup(
|
|
@@ -46,5 +47,5 @@ setup(
|
|
|
46
47
|
long_description=pathlib.Path("README.md").read_text(), # noqa: E501
|
|
47
48
|
package_data={"weheat": ["py.typed"]},
|
|
48
49
|
license="MIT",
|
|
49
|
-
license_files
|
|
50
|
+
license_files=('LICENSE',),
|
|
50
51
|
)
|
|
@@ -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
|
-
|
|
@@ -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:
|
|
@@ -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
|
|
@@ -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
|