From 6b75276f31d9ff08d6aab1a058eb2a5acd6ec3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B6rrle?= Date: Wed, 10 Jan 2024 13:00:14 +0100 Subject: [PATCH 1/2] Make fuel_level optional --- mytoyota/models/endpoints/telemetry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mytoyota/models/endpoints/telemetry.py b/mytoyota/models/endpoints/telemetry.py index 0f8531fb..02efafad 100644 --- a/mytoyota/models/endpoints/telemetry.py +++ b/mytoyota/models/endpoints/telemetry.py @@ -23,7 +23,7 @@ class TelemetryModel(BaseModel): fuel_type: str = Field(alias="fuelType") odometer: UnitValueModel - fuel_level: int = Field(alias="fuelLevel") + fuel_level: Optional[int] = Field(alias="fuelLevel", default=None) distance_to_empty: Optional[UnitValueModel] = Field(alias="distanceToEmpty", default=None) timestamp: datetime From 806222b57991925023266ba54975902c7228bc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B6rrle?= Date: Wed, 10 Jan 2024 13:02:38 +0100 Subject: [PATCH 2/2] adjust docstring --- mytoyota/models/endpoints/telemetry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mytoyota/models/endpoints/telemetry.py b/mytoyota/models/endpoints/telemetry.py index 02efafad..9bfb65e3 100644 --- a/mytoyota/models/endpoints/telemetry.py +++ b/mytoyota/models/endpoints/telemetry.py @@ -14,7 +14,7 @@ class TelemetryModel(BaseModel): ---------- fuel_type (str): The type of fuel. odometer (UnitValueModel): The odometer reading. - fuel_level (int): The fuel level. + fuel_level (Optional[int]): The fuel level. distance_to_empty (Optional[UnitValueModel], optional): The estimated distance to empty. \n Defaults to None. timestamp (datetime): The timestamp of the telemetry data.