Skip to content

Commit 3a8de08

Browse files
authored
Merge pull request #15 from SAIC-iSmart-API/develop
Release 0.8.0
2 parents 9dbd350 + 8ba072c commit 3a8de08

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ required-imports = ["from __future__ import annotations"]
144144
"D104", # Missing docstring in public package
145145
"N802", # Function name {name} should be lowercase
146146
"N816", # Variable {name} in global scope should not be mixedCase
147-
"PLR0913", # Too many arguments in function definition
148147
"S101", # Use of assert detected
149148
"SLF001", # Private member accessed: {access}
150149
"T201", # print found
@@ -154,7 +153,7 @@ required-imports = ["from __future__ import annotations"]
154153
max-complexity = 13
155154

156155
[tool.ruff.lint.pylint]
157-
max-args = 7
156+
max-args = 10
158157

159158
[tool.mypy]
160159
files = ["./src", "./tests"]

src/saic_ismart_client_ng/api/vehicle/alarm/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
)
1010
from saic_ismart_client_ng.crypto_utils import sha256_hex_digest
1111

12+
__all__ = [
13+
"AlarmSwitch",
14+
"AlarmSwitchReq",
15+
"AlarmSwitchResp",
16+
"AlarmType",
17+
]
18+
1219

1320
class SaicVehicleAlarmApi(SaicVehicleApi):
1421
async def get_alarm_switch(self, vin: str) -> AlarmSwitchResp:

src/saic_ismart_client_ng/api/vehicle/schema.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ class BasicVehicleStatus:
108108
vehicleAlarmStatus: int | None = None
109109
wheelTyreMonitorStatus: int | None = None
110110

111+
@property
112+
def is_parked(self) -> bool:
113+
return self.engineStatus != 1 or self.handBrake == 1
114+
115+
@property
116+
def is_engine_running(self) -> bool:
117+
return self.engineStatus == 1
118+
111119

112120
@dataclass
113121
class ExtendedVehicleStatus:
@@ -124,16 +132,6 @@ class VehicleStatusResp:
124132
gpsPosition: GpsPosition | None = None
125133
statusTime: int | None = None
126134

127-
@property
128-
def is_parked(self) -> bool:
129-
return (v := self.basicVehicleStatus) is not None and (
130-
v.engineStatus != 1 or v.handBrake == 1
131-
)
132-
133-
@property
134-
def is_engine_running(self) -> bool:
135-
return (v := self.basicVehicleStatus) is not None and v.engineStatus == 1
136-
137135

138136
class RvcParamsId(Enum):
139137
FIND_MY_CAR_ENABLE = 1

src/saic_ismart_client_ng/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)