myvsb-developer-api 0.2.0__tar.gz → 1.0.1__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.
- {myvsb_developer_api-0.2.0/src/myvsb_developer_api.egg-info → myvsb_developer_api-1.0.1}/PKG-INFO +1 -1
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/pyproject.toml +1 -1
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/const.py +2 -1
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/open_api_client.py +23 -15
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/rest_api.py +7 -4
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/air_conditioning.py +0 -1
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/auxiliary_heating.py +1 -0
- myvsb_developer_api-1.0.1/src/myskoda_openapi/models/configurations.py +34 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1/src/myvsb_developer_api.egg-info}/PKG-INFO +1 -1
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myvsb_developer_api.egg-info/SOURCES.txt +1 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/LICENSE +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/README.md +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/setup.cfg +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/exceptions.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/utils.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/active_ventilation.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/base_model.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/charging.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/charging_profiles.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/common.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/driving_range.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/enums.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/parking_position.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/vehicle.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/vehicle_status.py +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myvsb_developer_api.egg-info/dependency_links.txt +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myvsb_developer_api.egg-info/requires.txt +0 -0
- {myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myvsb_developer_api.egg-info/top_level.txt +0 -0
{myvsb_developer_api-0.2.0/src/myvsb_developer_api.egg-info → myvsb_developer_api-1.0.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: myvsb-developer-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Asynchronous Python library for the MyVSB Developer API
|
|
5
5
|
Author-email: net0045 <stepan.netolicky@vsb.cz>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mobility-lab-vsb/myvsb-developer-api
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/const.py
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
SANDBOX_BASE_URL = "https://developer.sandbox.connect.skoda-auto.cz"
|
|
2
2
|
PRODUCTION_BASE_URL = "https://developer.connect.skoda-auto.cz"
|
|
3
|
-
TEST_BASE_URL = "https://public.test-api.connect.skoda-auto.cz"
|
|
3
|
+
TEST_BASE_URL = "https://public.test-api.connect.skoda-auto.cz"
|
|
4
|
+
BETA_URL = "https://public.api.connect.skoda-auto.cz"
|
|
@@ -11,6 +11,7 @@ from ..models.auxiliary_heating import AuxiliaryHeating
|
|
|
11
11
|
from ..models.charging import Charging
|
|
12
12
|
from ..models.driving_range import FuelStatus
|
|
13
13
|
from ..models.charging_profiles import ChargingProfiles
|
|
14
|
+
from ..models.configurations import StartAirConditioningConfiguration, StartAuxiliaryHeatingConfiguration, ConfigurationTargetTemperature
|
|
14
15
|
|
|
15
16
|
class OpenAPIClient:
|
|
16
17
|
"""Client for interacting with rest API and used in HomeAssistant."""
|
|
@@ -70,10 +71,16 @@ class OpenAPIClient:
|
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
|
|
73
|
-
async def start_air_conditioning(self, vin: str, temperature: float) -> None:
|
|
74
|
+
async def start_air_conditioning(self, vin: str, temperature: float, unit: str = "CELSIUS", without_external_power: bool = True) -> None:
|
|
74
75
|
"""Starts the air conditioning for the vehicle with the given VIN."""
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
config = StartAirConditioningConfiguration(
|
|
77
|
+
target_temperature=ConfigurationTargetTemperature(
|
|
78
|
+
temperature_value=temperature,
|
|
79
|
+
unit_in_car=unit,
|
|
80
|
+
),
|
|
81
|
+
air_conditioning_without_external_power=without_external_power,
|
|
82
|
+
)
|
|
83
|
+
await self.rest_api.start_air_conditioning(vin, config)
|
|
77
84
|
|
|
78
85
|
async def stop_air_conditioning(self, vin: str) -> None:
|
|
79
86
|
"""Stops the air_conditioning of the vehicle and return None if it was succesfull else catch an exception in HomeAssistant"""
|
|
@@ -81,19 +88,20 @@ class OpenAPIClient:
|
|
|
81
88
|
|
|
82
89
|
async def start_auxiliary_heating(self, vin: str, spin: str, duration_in_seconds: int = 120, start_mode: str = "HEATING", target_temperature: Optional[float] = None, unit: str = "CELSIUS") -> None:
|
|
83
90
|
"""Starts the auxiliary heating for the vehicle with the given VIN."""
|
|
84
|
-
|
|
85
|
-
"spin": spin,
|
|
86
|
-
"durationInSeconds": duration_in_seconds,
|
|
87
|
-
"startMode": start_mode
|
|
88
|
-
}
|
|
89
|
-
# If there is target temperature, add it into the payload
|
|
91
|
+
temp_obj = None
|
|
90
92
|
if target_temperature is not None:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
temp_obj = ConfigurationTargetTemperature(
|
|
94
|
+
temperature_value=target_temperature,
|
|
95
|
+
unit_in_car=unit,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
config = StartAuxiliaryHeatingConfiguration(
|
|
99
|
+
spin=spin,
|
|
100
|
+
duration_in_seconds=duration_in_seconds,
|
|
101
|
+
start_mode=start_mode,
|
|
102
|
+
target_temperature=temp_obj,
|
|
103
|
+
)
|
|
104
|
+
await self.rest_api.start_auxiliary_heating(vin, config)
|
|
97
105
|
|
|
98
106
|
async def stop_auxiliary_heating(self, vin: str) -> None:
|
|
99
107
|
"""Stops the auxiliary_heating of the vehicle and return None if it was succesfull else catch an exception in HomeAssistant"""
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/rest_api.py
RENAMED
|
@@ -3,7 +3,7 @@ import logging
|
|
|
3
3
|
from typing import Generic, Optional, TypeVar, Any, List
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from aiohttp import ClientResponseError, ClientSession
|
|
6
|
-
from .const import SANDBOX_BASE_URL, PRODUCTION_BASE_URL, TEST_BASE_URL
|
|
6
|
+
from .const import SANDBOX_BASE_URL, PRODUCTION_BASE_URL, TEST_BASE_URL, BETA_URL
|
|
7
7
|
from ..models.vehicle import VehicleResponse
|
|
8
8
|
from ..models.vehicle_status import VehicleStatus
|
|
9
9
|
from ..models.vehicle import Odometer
|
|
@@ -14,6 +14,7 @@ from ..models.charging import Charging
|
|
|
14
14
|
from ..models.active_ventilation import ActiveVentilation
|
|
15
15
|
from ..models.charging_profiles import ChargingProfiles
|
|
16
16
|
from ..models.driving_range import FuelStatus
|
|
17
|
+
from ..models.configurations import StartAirConditioningConfiguration, StartAuxiliaryHeatingConfiguration
|
|
17
18
|
from .exceptions import (
|
|
18
19
|
OpenApiError,
|
|
19
20
|
OpenApiAuthenticationError,
|
|
@@ -46,7 +47,7 @@ class SkodaRestAPI:
|
|
|
46
47
|
def __init__(self, api_key: str, session: ClientSession) -> None:
|
|
47
48
|
self._api_key = api_key
|
|
48
49
|
self._session = session
|
|
49
|
-
self._base_url =
|
|
50
|
+
self._base_url = BETA_URL # Default to BETA_URL; can be changed to SANDBOX_BASE_URL or PRODUCTION_BASE_URL as needed.
|
|
50
51
|
#TODO will be exteded with methods for authorization, token management, and other endpoints as needed.
|
|
51
52
|
|
|
52
53
|
async def _make_post_request(self, url: str, json_data: Optional[dict] = None) -> int:
|
|
@@ -224,10 +225,11 @@ class SkodaRestAPI:
|
|
|
224
225
|
# =========================================================================
|
|
225
226
|
# ENDPOINT METHODS - POST
|
|
226
227
|
# =========================================================================
|
|
227
|
-
async def start_air_conditioning(self, vin: str,
|
|
228
|
+
async def start_air_conditioning(self, vin: str, config: StartAirConditioningConfiguration) -> PostEndpointResult:
|
|
228
229
|
"""Starts the air conditioning for the vehicle with the given VIN. The payload should contain any necessary parameters for starting the air conditioning."""
|
|
229
230
|
url = f"/api/v1/vehicles/{vin}/air-conditioning/start"
|
|
230
231
|
|
|
232
|
+
payload = config.model_dump(by_alias=True, exclude_none=True)
|
|
231
233
|
status = await self._make_post_request(url, json_data=payload)
|
|
232
234
|
return PostEndpointResult(url=url, status=status, headers={})
|
|
233
235
|
|
|
@@ -238,10 +240,11 @@ class SkodaRestAPI:
|
|
|
238
240
|
status = await self._make_post_request(url)
|
|
239
241
|
return PostEndpointResult(url=url, status=status, headers={})
|
|
240
242
|
|
|
241
|
-
async def start_auxiliary_heating(self, vin: str,
|
|
243
|
+
async def start_auxiliary_heating(self, vin: str, config: StartAuxiliaryHeatingConfiguration) -> PostEndpointResult:
|
|
242
244
|
"""Starts the auxiliary heating for the vehicle with the given VIN. The payload should contain any necessary parameters for starting the auxiliary heating."""
|
|
243
245
|
url = f"/api/v1/vehicles/{vin}/auxiliary-heating/start"
|
|
244
246
|
|
|
247
|
+
payload = config.model_dump(by_alias=True, exclude_none=True)
|
|
245
248
|
status = await self._make_post_request(url, json_data=payload)
|
|
246
249
|
return PostEndpointResult(url=url, status=status, headers={})
|
|
247
250
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from pydantic import Field
|
|
3
|
+
from .base_model import BaseModel
|
|
4
|
+
|
|
5
|
+
class ConfigurationTargetTemperature(BaseModel):
|
|
6
|
+
temperature_value: float = Field(..., alias="temperatureValue")
|
|
7
|
+
unit_in_car: str = Field("CELSIUS", alias="unitInCar")
|
|
8
|
+
|
|
9
|
+
class Config:
|
|
10
|
+
populate_by_name = True
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class StartAirConditioningConfiguration(BaseModel):
|
|
14
|
+
"""Configuration for starting air conditioning."""
|
|
15
|
+
target_temperature: Optional[ConfigurationTargetTemperature] = Field(None, alias="targetTemperature")
|
|
16
|
+
spin: Optional[str] = Field(None, alias="spin")
|
|
17
|
+
heater_source: Optional[str] = Field(None, alias="heaterSource")
|
|
18
|
+
air_conditioning_without_external_power: Optional[bool] = Field(
|
|
19
|
+
True, alias="airConditioningWithoutExternalPower"
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
class Config:
|
|
23
|
+
populate_by_name = True
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class StartAuxiliaryHeatingConfiguration(BaseModel):
|
|
27
|
+
"""Configuration for starting auxiliary heating."""
|
|
28
|
+
spin: str = Field(..., alias="spin")
|
|
29
|
+
duration_in_seconds: Optional[int] = Field(120, alias="durationInSeconds")
|
|
30
|
+
start_mode: Optional[str] = Field("HEATING", alias="startMode")
|
|
31
|
+
target_temperature: Optional[ConfigurationTargetTemperature] = Field(None, alias="targetTemperature")
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
populate_by_name = True
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1/src/myvsb_developer_api.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: myvsb-developer-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Asynchronous Python library for the MyVSB Developer API
|
|
5
5
|
Author-email: net0045 <stepan.netolicky@vsb.cz>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mobility-lab-vsb/myvsb-developer-api
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myvsb_developer_api.egg-info/SOURCES.txt
RENAMED
|
@@ -13,6 +13,7 @@ src/myskoda_openapi/models/base_model.py
|
|
|
13
13
|
src/myskoda_openapi/models/charging.py
|
|
14
14
|
src/myskoda_openapi/models/charging_profiles.py
|
|
15
15
|
src/myskoda_openapi/models/common.py
|
|
16
|
+
src/myskoda_openapi/models/configurations.py
|
|
16
17
|
src/myskoda_openapi/models/driving_range.py
|
|
17
18
|
src/myskoda_openapi/models/enums.py
|
|
18
19
|
src/myskoda_openapi/models/parking_position.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/exceptions.py
RENAMED
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/api_layer/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/base_model.py
RENAMED
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/charging.py
RENAMED
|
File without changes
|
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/common.py
RENAMED
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/driving_range.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/vehicle.py
RENAMED
|
File without changes
|
{myvsb_developer_api-0.2.0 → myvsb_developer_api-1.0.1}/src/myskoda_openapi/models/vehicle_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|