Skip to content

Commit

Permalink
Remove EV distance to empty, and _gas suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Blueion76 authored Feb 3, 2025
1 parent 39ccd07 commit bb6c4f1
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pyfiat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ class Vehicle:
days_to_service: int = None
distance_to_service: int = None
distance_to_service_unit: str = None
distance_to_empty_gas: int = None
distance_to_empty_gas_unit: str = None
distance_to_empty_ev: int = None
distance_to_empty_ev_unit: str = None
distance_to_empty: int = None
distance_to_empty_unit: str = None
battery_voltage: float = None
oil_level: int = None
fuel_low_gas: bool = None
fuel_amount_gas: int = None
fuel_low: bool = None
fuel_amount: int = None

# EV related
plugged_in: bool = None
Expand Down Expand Up @@ -166,12 +164,10 @@ def _update_vehicle(v: Vehicle, p: dict) -> Vehicle:
vi, "distanceToService", "distanceToService", "value")
v.distance_to_service_unit = sg(
vi, "distanceToService", "distanceToService", "unit")
v.distance_to_empty_gas = sg(vi, "fuel", "distanceToEmpty", "value")
v.distance_to_empty_gas_unit = sg(vi, "fuel", "distanceToEmpty", "unit")
v.distance_to_empty_ev = sg(batt, "distanceToEmpty", "value")
v.distance_to_empty_ev_unit = sg(batt, "distanceToEmpty", "unit")
v.fuel_low_gas = sg(vi, "fuel", "isFuelLevelLow")
v.fuel_amount_gas = sg(vi, "fuel", "fuelAmountLevel")
v.distance_to_empty = sg(vi, "fuel", "distanceToEmpty", "value")
v.distance_to_empty_unit = sg(vi, "fuel", "distanceToEmpty", "unit")
v.fuel_low = sg(vi, "fuel", "isFuelLevelLow")
v.fuel_amount = sg(vi, "fuel", "fuelAmountLevel")
v.oil_level = sg(vi, "oilLevel", "oilLevel")

v.ignition_on = sg_eq(ev, "ON", "ignitionStatus")
Expand Down

0 comments on commit bb6c4f1

Please sign in to comment.