diff --git a/poetry.lock b/poetry.lock index fcba2ff..fa0b49f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -634,5 +634,5 @@ markers = {main = "python_version < \"3.13\""} [metadata] lock-version = "2.1" -python-versions = "^3.11" -content-hash = "c4d5825844d9cc966c0f5e409ae372b02442f57103e3921f279297f6ec9b20ba" +python-versions = ">=3.11" +content-hash = "d6b04e1d72de52966acd56aa4513b8f64238f77bbddfc46005aa612f068e1022" diff --git a/pyproject.toml b/pyproject.toml index bd02195..2609f02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -144,7 +144,6 @@ required-imports = ["from __future__ import annotations"] "D104", # Missing docstring in public package "N802", # Function name {name} should be lowercase "N816", # Variable {name} in global scope should not be mixedCase - "PLR0913", # Too many arguments in function definition "S101", # Use of assert detected "SLF001", # Private member accessed: {access} "T201", # print found @@ -154,7 +153,7 @@ required-imports = ["from __future__ import annotations"] max-complexity = 13 [tool.ruff.lint.pylint] -max-args = 7 +max-args = 10 [tool.mypy] files = ["./src", "./tests"] diff --git a/src/saic_ismart_client_ng/api/vehicle/alarm/__init__.py b/src/saic_ismart_client_ng/api/vehicle/alarm/__init__.py index c7b3e93..f97105a 100644 --- a/src/saic_ismart_client_ng/api/vehicle/alarm/__init__.py +++ b/src/saic_ismart_client_ng/api/vehicle/alarm/__init__.py @@ -9,6 +9,13 @@ ) from saic_ismart_client_ng.crypto_utils import sha256_hex_digest +__all__ = [ + "AlarmSwitch", + "AlarmSwitchReq", + "AlarmSwitchResp", + "AlarmType", +] + class SaicVehicleAlarmApi(SaicVehicleApi): async def get_alarm_switch(self, vin: str) -> AlarmSwitchResp: diff --git a/src/saic_ismart_client_ng/api/vehicle/schema.py b/src/saic_ismart_client_ng/api/vehicle/schema.py index eb2667d..043caa1 100644 --- a/src/saic_ismart_client_ng/api/vehicle/schema.py +++ b/src/saic_ismart_client_ng/api/vehicle/schema.py @@ -108,6 +108,14 @@ class BasicVehicleStatus: vehicleAlarmStatus: int | None = None wheelTyreMonitorStatus: int | None = None + @property + def is_parked(self) -> bool: + return self.engineStatus != 1 or self.handBrake == 1 + + @property + def is_engine_running(self) -> bool: + return self.engineStatus == 1 + @dataclass class ExtendedVehicleStatus: @@ -124,16 +132,6 @@ class VehicleStatusResp: gpsPosition: GpsPosition | None = None statusTime: int | None = None - @property - def is_parked(self) -> bool: - return (v := self.basicVehicleStatus) is not None and ( - v.engineStatus != 1 or v.handBrake == 1 - ) - - @property - def is_engine_running(self) -> bool: - return (v := self.basicVehicleStatus) is not None and v.engineStatus == 1 - class RvcParamsId(Enum): FIND_MY_CAR_ENABLE = 1 diff --git a/src/saic_ismart_client_ng/py.typed b/src/saic_ismart_client_ng/py.typed new file mode 100644 index 0000000..e69de29