volkswagencarnet 5.0.0b1__py3-none-any.whl → 5.0.0b3__py3-none-any.whl
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.
Potentially problematic release.
This version of volkswagencarnet might be problematic. Click here for more details.
- volkswagencarnet/version.py +1 -1
- volkswagencarnet/vw_dashboard.py +37 -0
- volkswagencarnet/vw_vehicle.py +293 -30
- {volkswagencarnet-5.0.0b1.dist-info → volkswagencarnet-5.0.0b3.dist-info}/METADATA +1 -1
- volkswagencarnet-5.0.0b3.dist-info/RECORD +12 -0
- volkswagencarnet-5.0.0b1.dist-info/RECORD +0 -12
- {volkswagencarnet-5.0.0b1.dist-info → volkswagencarnet-5.0.0b3.dist-info}/LICENSE.txt +0 -0
- {volkswagencarnet-5.0.0b1.dist-info → volkswagencarnet-5.0.0b3.dist-info}/WHEEL +0 -0
- {volkswagencarnet-5.0.0b1.dist-info → volkswagencarnet-5.0.0b3.dist-info}/top_level.txt +0 -0
volkswagencarnet/version.py
CHANGED
volkswagencarnet/vw_dashboard.py
CHANGED
|
@@ -1351,6 +1351,18 @@ def create_instruments():
|
|
|
1351
1351
|
icon="mdi:battery-arrow-up",
|
|
1352
1352
|
unit="%",
|
|
1353
1353
|
),
|
|
1354
|
+
Sensor(
|
|
1355
|
+
attr="hv_battery_min_temperature",
|
|
1356
|
+
name="HV battery min temperature",
|
|
1357
|
+
icon="mdi:thermometer-chevron-down",
|
|
1358
|
+
unit=TEMP_CELSIUS,
|
|
1359
|
+
),
|
|
1360
|
+
Sensor(
|
|
1361
|
+
attr="hv_battery_max_temperature",
|
|
1362
|
+
name="HV battery max temperature",
|
|
1363
|
+
icon="mdi:thermometer-chevron-up",
|
|
1364
|
+
unit=TEMP_CELSIUS,
|
|
1365
|
+
),
|
|
1354
1366
|
Sensor(
|
|
1355
1367
|
attr="adblue_level",
|
|
1356
1368
|
name="Adblue level",
|
|
@@ -1363,6 +1375,12 @@ def create_instruments():
|
|
|
1363
1375
|
icon="mdi:fuel",
|
|
1364
1376
|
unit="%",
|
|
1365
1377
|
),
|
|
1378
|
+
Sensor(
|
|
1379
|
+
attr="gas_level",
|
|
1380
|
+
name="Gas level",
|
|
1381
|
+
icon="mdi:gas-cylinder",
|
|
1382
|
+
unit="%",
|
|
1383
|
+
),
|
|
1366
1384
|
Sensor(
|
|
1367
1385
|
attr="service_inspection",
|
|
1368
1386
|
name="Service inspection days",
|
|
@@ -1421,6 +1439,18 @@ def create_instruments():
|
|
|
1421
1439
|
icon="mdi:car",
|
|
1422
1440
|
unit="km",
|
|
1423
1441
|
),
|
|
1442
|
+
Sensor(
|
|
1443
|
+
attr="fuel_range",
|
|
1444
|
+
name="Fuel range",
|
|
1445
|
+
icon="mdi:car",
|
|
1446
|
+
unit="km",
|
|
1447
|
+
),
|
|
1448
|
+
Sensor(
|
|
1449
|
+
attr="gas_range",
|
|
1450
|
+
name="Gas range",
|
|
1451
|
+
icon="mdi:car",
|
|
1452
|
+
unit="km",
|
|
1453
|
+
),
|
|
1424
1454
|
Sensor(
|
|
1425
1455
|
attr="combined_range",
|
|
1426
1456
|
name="Combined range",
|
|
@@ -1492,6 +1522,13 @@ def create_instruments():
|
|
|
1492
1522
|
unit="l/100 km",
|
|
1493
1523
|
state_class=VWStateClass.MEASUREMENT,
|
|
1494
1524
|
),
|
|
1525
|
+
Sensor(
|
|
1526
|
+
attr="trip_last_average_gas_consumption",
|
|
1527
|
+
name="Last trip average gas consumption",
|
|
1528
|
+
icon="mdi:gas-cylinder",
|
|
1529
|
+
unit="m3/100km",
|
|
1530
|
+
state_class=VWStateClass.MEASUREMENT,
|
|
1531
|
+
),
|
|
1495
1532
|
Sensor(
|
|
1496
1533
|
attr="trip_last_duration",
|
|
1497
1534
|
name="Last trip duration",
|
volkswagencarnet/vw_vehicle.py
CHANGED
|
@@ -25,8 +25,14 @@ _LOGGER = logging.getLogger(__name__)
|
|
|
25
25
|
ENGINE_TYPE_ELECTRIC = "electric"
|
|
26
26
|
ENGINE_TYPE_DIESEL = "diesel"
|
|
27
27
|
ENGINE_TYPE_GASOLINE = "gasoline"
|
|
28
|
+
ENGINE_TYPE_CNG = "cng"
|
|
28
29
|
ENGINE_TYPE_HYBRID = "hybrid"
|
|
29
|
-
ENGINE_TYPE_COMBUSTION = [
|
|
30
|
+
ENGINE_TYPE_COMBUSTION = [
|
|
31
|
+
ENGINE_TYPE_DIESEL,
|
|
32
|
+
ENGINE_TYPE_GASOLINE,
|
|
33
|
+
ENGINE_TYPE_CNG,
|
|
34
|
+
]
|
|
35
|
+
ENGINE_TYPE_GAS = [ENGINE_TYPE_CNG]
|
|
30
36
|
DEFAULT_TARGET_TEMP = 24
|
|
31
37
|
|
|
32
38
|
|
|
@@ -292,28 +298,6 @@ class Vehicle:
|
|
|
292
298
|
|
|
293
299
|
# Data set functions
|
|
294
300
|
# Charging (BATTERYCHARGE)
|
|
295
|
-
async def set_charger_current(self, value):
|
|
296
|
-
"""Set charger current."""
|
|
297
|
-
if self.is_charging_supported:
|
|
298
|
-
if 1 <= int(value) <= 255:
|
|
299
|
-
data = {
|
|
300
|
-
"action": {
|
|
301
|
-
"settings": {"maxChargeCurrent": int(value)},
|
|
302
|
-
"type": "setSettings",
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
else:
|
|
306
|
-
_LOGGER.error(
|
|
307
|
-
"Set charger maximum current to %s is not supported", value
|
|
308
|
-
)
|
|
309
|
-
# pylint: disable=broad-exception-raised
|
|
310
|
-
raise Exception(
|
|
311
|
-
f"Set charger maximum current to {value} is not supported."
|
|
312
|
-
)
|
|
313
|
-
return await self.set_charger(data)
|
|
314
|
-
_LOGGER.error("No charger support")
|
|
315
|
-
raise Exception("No charger support.") # pylint: disable=broad-exception-raised
|
|
316
|
-
|
|
317
301
|
async def set_charger(self, action) -> bool:
|
|
318
302
|
"""Turn on/off charging."""
|
|
319
303
|
if self.is_charging_supported:
|
|
@@ -336,12 +320,24 @@ class Vehicle:
|
|
|
336
320
|
self.is_charge_max_ac_setting_supported
|
|
337
321
|
or self.is_auto_release_ac_connector_supported
|
|
338
322
|
or self.is_battery_target_charge_level_supported
|
|
323
|
+
or self.is_charge_max_ac_ampere_supported
|
|
339
324
|
):
|
|
340
325
|
if setting == "reduced_ac_charging" and value not in ["reduced", "maximum"]:
|
|
341
326
|
_LOGGER.error('Charging setting "%s" is not supported', value)
|
|
342
327
|
raise Exception(f'Charging setting "{value}" is not supported.') # pylint: disable=broad-exception-raised
|
|
328
|
+
if setting == "max_charge_amperage" and int(value) not in [5, 10, 13, 32]:
|
|
329
|
+
_LOGGER.error(
|
|
330
|
+
"Setting maximum charge amperage to %s is not supported", value
|
|
331
|
+
)
|
|
332
|
+
# pylint: disable=broad-exception-raised
|
|
333
|
+
raise Exception(
|
|
334
|
+
f"Setting maximum charge amperage to {value} is not supported."
|
|
335
|
+
)
|
|
343
336
|
data = {}
|
|
344
|
-
if
|
|
337
|
+
if (
|
|
338
|
+
self.is_charge_max_ac_setting_supported
|
|
339
|
+
and setting != "max_charge_amperage"
|
|
340
|
+
):
|
|
345
341
|
data["maxChargeCurrentAC"] = (
|
|
346
342
|
value
|
|
347
343
|
if setting == "reduced_ac_charging"
|
|
@@ -360,6 +356,15 @@ class Vehicle:
|
|
|
360
356
|
if setting == "battery_target_charge_level"
|
|
361
357
|
else self.battery_target_charge_level
|
|
362
358
|
)
|
|
359
|
+
if (
|
|
360
|
+
self.is_charge_max_ac_ampere_supported
|
|
361
|
+
and setting != "reduced_ac_charging"
|
|
362
|
+
):
|
|
363
|
+
data["maxChargeCurrentAC_A"] = (
|
|
364
|
+
int(value)
|
|
365
|
+
if setting == "max_charge_amperage"
|
|
366
|
+
else self.charge_max_ac_ampere
|
|
367
|
+
)
|
|
363
368
|
self._requests["latest"] = "Batterycharge"
|
|
364
369
|
response = await self._connection.setChargingSettings(self.vin, data)
|
|
365
370
|
return await self._handle_response(
|
|
@@ -887,7 +892,7 @@ class Vehicle:
|
|
|
887
892
|
for light in lights:
|
|
888
893
|
if light["status"] == "on":
|
|
889
894
|
lights_on_count = lights_on_count + 1
|
|
890
|
-
return lights_on_count ==
|
|
895
|
+
return lights_on_count == 2
|
|
891
896
|
|
|
892
897
|
@property
|
|
893
898
|
def parking_light_last_updated(self) -> datetime:
|
|
@@ -1239,6 +1244,64 @@ class Vehicle:
|
|
|
1239
1244
|
self.attrs, f"{Services.CHARGING}.chargingSettings.value.targetSOC_pct"
|
|
1240
1245
|
)
|
|
1241
1246
|
|
|
1247
|
+
@property
|
|
1248
|
+
def hv_battery_min_temperature(self) -> int:
|
|
1249
|
+
"""Return HV battery min temperature."""
|
|
1250
|
+
return (
|
|
1251
|
+
float(
|
|
1252
|
+
find_path(
|
|
1253
|
+
self.attrs,
|
|
1254
|
+
f"{Services.MEASUREMENTS}.temperatureBatteryStatus.value.temperatureHvBatteryMin_K",
|
|
1255
|
+
)
|
|
1256
|
+
)
|
|
1257
|
+
- 273.15
|
|
1258
|
+
)
|
|
1259
|
+
|
|
1260
|
+
@property
|
|
1261
|
+
def hv_battery_min_temperature_last_updated(self) -> datetime:
|
|
1262
|
+
"""Return attribute last updated timestamp."""
|
|
1263
|
+
return find_path(
|
|
1264
|
+
self.attrs,
|
|
1265
|
+
f"{Services.MEASUREMENTS}.temperatureBatteryStatus.value.carCapturedTimestamp",
|
|
1266
|
+
)
|
|
1267
|
+
|
|
1268
|
+
@property
|
|
1269
|
+
def is_hv_battery_min_temperature_supported(self) -> bool:
|
|
1270
|
+
"""Return true if HV battery min temperature is supported."""
|
|
1271
|
+
return is_valid_path(
|
|
1272
|
+
self.attrs,
|
|
1273
|
+
f"{Services.MEASUREMENTS}.temperatureBatteryStatus.value.temperatureHvBatteryMin_K",
|
|
1274
|
+
)
|
|
1275
|
+
|
|
1276
|
+
@property
|
|
1277
|
+
def hv_battery_max_temperature(self) -> int:
|
|
1278
|
+
"""Return HV battery max temperature."""
|
|
1279
|
+
return (
|
|
1280
|
+
float(
|
|
1281
|
+
find_path(
|
|
1282
|
+
self.attrs,
|
|
1283
|
+
f"{Services.MEASUREMENTS}.temperatureBatteryStatus.value.temperatureHvBatteryMax_K",
|
|
1284
|
+
)
|
|
1285
|
+
)
|
|
1286
|
+
- 273.15
|
|
1287
|
+
)
|
|
1288
|
+
|
|
1289
|
+
@property
|
|
1290
|
+
def hv_battery_max_temperature_last_updated(self) -> datetime:
|
|
1291
|
+
"""Return attribute last updated timestamp."""
|
|
1292
|
+
return find_path(
|
|
1293
|
+
self.attrs,
|
|
1294
|
+
f"{Services.MEASUREMENTS}.temperatureBatteryStatus.value.carCapturedTimestamp",
|
|
1295
|
+
)
|
|
1296
|
+
|
|
1297
|
+
@property
|
|
1298
|
+
def is_hv_battery_max_temperature_supported(self) -> bool:
|
|
1299
|
+
"""Return true if HV battery max temperature is supported."""
|
|
1300
|
+
return is_valid_path(
|
|
1301
|
+
self.attrs,
|
|
1302
|
+
f"{Services.MEASUREMENTS}.temperatureBatteryStatus.value.temperatureHvBatteryMax_K",
|
|
1303
|
+
)
|
|
1304
|
+
|
|
1242
1305
|
@property
|
|
1243
1306
|
def charge_max_ac_setting(self) -> str | int:
|
|
1244
1307
|
"""Return charger max ampere setting."""
|
|
@@ -1644,6 +1707,10 @@ class Vehicle:
|
|
|
1644
1707
|
"""
|
|
1645
1708
|
DIESEL_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.dieselRange"
|
|
1646
1709
|
GASOLINE_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.gasolineRange"
|
|
1710
|
+
CNG_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.cngRange"
|
|
1711
|
+
TOTAL_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.totalRange_km"
|
|
1712
|
+
if is_valid_path(self.attrs, CNG_RANGE):
|
|
1713
|
+
return find_path(self.attrs, TOTAL_RANGE)
|
|
1647
1714
|
if is_valid_path(self.attrs, DIESEL_RANGE):
|
|
1648
1715
|
return find_path(self.attrs, DIESEL_RANGE)
|
|
1649
1716
|
if is_valid_path(self.attrs, GASOLINE_RANGE):
|
|
@@ -1662,6 +1729,46 @@ class Vehicle:
|
|
|
1662
1729
|
def is_combustion_range_supported(self) -> bool:
|
|
1663
1730
|
"""Return true if combustion range is supported, i.e. false for EVs.
|
|
1664
1731
|
|
|
1732
|
+
:return:
|
|
1733
|
+
"""
|
|
1734
|
+
return (
|
|
1735
|
+
is_valid_path(
|
|
1736
|
+
self.attrs, f"{Services.MEASUREMENTS}.rangeStatus.value.dieselRange"
|
|
1737
|
+
)
|
|
1738
|
+
or is_valid_path(
|
|
1739
|
+
self.attrs, f"{Services.MEASUREMENTS}.rangeStatus.value.gasolineRange"
|
|
1740
|
+
)
|
|
1741
|
+
or is_valid_path(
|
|
1742
|
+
self.attrs, f"{Services.MEASUREMENTS}.rangeStatus.value.cngRange"
|
|
1743
|
+
)
|
|
1744
|
+
)
|
|
1745
|
+
|
|
1746
|
+
@property
|
|
1747
|
+
def fuel_range(self) -> int:
|
|
1748
|
+
"""Return fuel engine range.
|
|
1749
|
+
|
|
1750
|
+
:return:
|
|
1751
|
+
"""
|
|
1752
|
+
DIESEL_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.dieselRange"
|
|
1753
|
+
GASOLINE_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.gasolineRange"
|
|
1754
|
+
if is_valid_path(self.attrs, DIESEL_RANGE):
|
|
1755
|
+
return find_path(self.attrs, DIESEL_RANGE)
|
|
1756
|
+
if is_valid_path(self.attrs, GASOLINE_RANGE):
|
|
1757
|
+
return find_path(self.attrs, GASOLINE_RANGE)
|
|
1758
|
+
return -1
|
|
1759
|
+
|
|
1760
|
+
@property
|
|
1761
|
+
def fuel_range_last_updated(self) -> datetime | None:
|
|
1762
|
+
"""Return fuel engine range last updated."""
|
|
1763
|
+
return find_path(
|
|
1764
|
+
self.attrs,
|
|
1765
|
+
f"{Services.MEASUREMENTS}.rangeStatus.value.carCapturedTimestamp",
|
|
1766
|
+
)
|
|
1767
|
+
|
|
1768
|
+
@property
|
|
1769
|
+
def is_fuel_range_supported(self) -> bool:
|
|
1770
|
+
"""Return true if fuel range is supported, i.e. false for EVs.
|
|
1771
|
+
|
|
1665
1772
|
:return:
|
|
1666
1773
|
"""
|
|
1667
1774
|
return is_valid_path(
|
|
@@ -1670,6 +1777,35 @@ class Vehicle:
|
|
|
1670
1777
|
self.attrs, f"{Services.MEASUREMENTS}.rangeStatus.value.gasolineRange"
|
|
1671
1778
|
)
|
|
1672
1779
|
|
|
1780
|
+
@property
|
|
1781
|
+
def gas_range(self) -> int:
|
|
1782
|
+
"""Return gas engine range.
|
|
1783
|
+
|
|
1784
|
+
:return:
|
|
1785
|
+
"""
|
|
1786
|
+
CNG_RANGE = f"{Services.MEASUREMENTS}.rangeStatus.value.cngRange"
|
|
1787
|
+
if is_valid_path(self.attrs, CNG_RANGE):
|
|
1788
|
+
return find_path(self.attrs, CNG_RANGE)
|
|
1789
|
+
return -1
|
|
1790
|
+
|
|
1791
|
+
@property
|
|
1792
|
+
def gas_range_last_updated(self) -> datetime | None:
|
|
1793
|
+
"""Return gas engine range last updated."""
|
|
1794
|
+
return find_path(
|
|
1795
|
+
self.attrs,
|
|
1796
|
+
f"{Services.MEASUREMENTS}.rangeStatus.value.carCapturedTimestamp",
|
|
1797
|
+
)
|
|
1798
|
+
|
|
1799
|
+
@property
|
|
1800
|
+
def is_gas_range_supported(self) -> bool:
|
|
1801
|
+
"""Return true if gas range is supported, i.e. false for EVs.
|
|
1802
|
+
|
|
1803
|
+
:return:
|
|
1804
|
+
"""
|
|
1805
|
+
return is_valid_path(
|
|
1806
|
+
self.attrs, f"{Services.MEASUREMENTS}.rangeStatus.value.cngRange"
|
|
1807
|
+
)
|
|
1808
|
+
|
|
1673
1809
|
@property
|
|
1674
1810
|
def combined_range(self) -> int:
|
|
1675
1811
|
"""Return combined range.
|
|
@@ -1738,9 +1874,12 @@ class Vehicle:
|
|
|
1738
1874
|
:return:
|
|
1739
1875
|
"""
|
|
1740
1876
|
fuel_level_pct = ""
|
|
1741
|
-
if
|
|
1742
|
-
|
|
1743
|
-
|
|
1877
|
+
if (
|
|
1878
|
+
is_valid_path(
|
|
1879
|
+
self.attrs,
|
|
1880
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.primaryEngine.currentFuelLevel_pct",
|
|
1881
|
+
)
|
|
1882
|
+
and not self.is_primary_drive_gas()
|
|
1744
1883
|
):
|
|
1745
1884
|
fuel_level_pct = find_path(
|
|
1746
1885
|
self.attrs,
|
|
@@ -1785,12 +1924,87 @@ class Vehicle:
|
|
|
1785
1924
|
|
|
1786
1925
|
:return:
|
|
1787
1926
|
"""
|
|
1788
|
-
return
|
|
1927
|
+
return (
|
|
1928
|
+
is_valid_path(
|
|
1929
|
+
self.attrs,
|
|
1930
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.primaryEngine.currentFuelLevel_pct",
|
|
1931
|
+
)
|
|
1932
|
+
and not self.is_primary_drive_gas()
|
|
1933
|
+
) or is_valid_path(
|
|
1789
1934
|
self.attrs,
|
|
1790
1935
|
f"{Services.MEASUREMENTS}.fuelLevelStatus.value.currentFuelLevel_pct",
|
|
1936
|
+
)
|
|
1937
|
+
|
|
1938
|
+
@property
|
|
1939
|
+
def gas_level(self) -> int:
|
|
1940
|
+
"""Return gas level.
|
|
1941
|
+
|
|
1942
|
+
:return:
|
|
1943
|
+
"""
|
|
1944
|
+
gas_level_pct = ""
|
|
1945
|
+
if (
|
|
1946
|
+
is_valid_path(
|
|
1947
|
+
self.attrs,
|
|
1948
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.primaryEngine.currentFuelLevel_pct",
|
|
1949
|
+
)
|
|
1950
|
+
and self.is_primary_drive_gas()
|
|
1951
|
+
):
|
|
1952
|
+
gas_level_pct = find_path(
|
|
1953
|
+
self.attrs,
|
|
1954
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.primaryEngine.currentFuelLevel_pct",
|
|
1955
|
+
)
|
|
1956
|
+
|
|
1957
|
+
if is_valid_path(
|
|
1958
|
+
self.attrs,
|
|
1959
|
+
f"{Services.MEASUREMENTS}.fuelLevelStatus.value.currentCngLevel_pct",
|
|
1960
|
+
):
|
|
1961
|
+
gas_level_pct = find_path(
|
|
1962
|
+
self.attrs,
|
|
1963
|
+
f"{Services.MEASUREMENTS}.fuelLevelStatus.value.currentCngLevel_pct",
|
|
1964
|
+
)
|
|
1965
|
+
return gas_level_pct
|
|
1966
|
+
|
|
1967
|
+
@property
|
|
1968
|
+
def gas_level_last_updated(self) -> datetime:
|
|
1969
|
+
"""Return gas level last updated."""
|
|
1970
|
+
gas_level_lastupdated = ""
|
|
1971
|
+
if (
|
|
1972
|
+
is_valid_path(
|
|
1973
|
+
self.attrs,
|
|
1974
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.carCapturedTimestamp",
|
|
1975
|
+
)
|
|
1976
|
+
and self.is_primary_drive_gas()
|
|
1977
|
+
):
|
|
1978
|
+
gas_level_lastupdated = find_path(
|
|
1979
|
+
self.attrs,
|
|
1980
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.carCapturedTimestamp",
|
|
1981
|
+
)
|
|
1982
|
+
|
|
1983
|
+
if is_valid_path(
|
|
1984
|
+
self.attrs,
|
|
1985
|
+
f"{Services.MEASUREMENTS}.fuelLevelStatus.value.carCapturedTimestamp",
|
|
1986
|
+
):
|
|
1987
|
+
gas_level_lastupdated = find_path(
|
|
1988
|
+
self.attrs,
|
|
1989
|
+
f"{Services.MEASUREMENTS}.fuelLevelStatus.value.carCapturedTimestamp",
|
|
1990
|
+
)
|
|
1991
|
+
return gas_level_lastupdated
|
|
1992
|
+
|
|
1993
|
+
@property
|
|
1994
|
+
def is_gas_level_supported(self) -> bool:
|
|
1995
|
+
"""Return true if gas level reporting is supported.
|
|
1996
|
+
|
|
1997
|
+
:return:
|
|
1998
|
+
"""
|
|
1999
|
+
return (
|
|
2000
|
+
is_valid_path(
|
|
2001
|
+
self.attrs,
|
|
2002
|
+
f"{Services.FUEL_STATUS}.rangeStatus.value.primaryEngine.currentFuelLevel_pct",
|
|
2003
|
+
)
|
|
2004
|
+
and self.is_primary_drive_gas()
|
|
1791
2005
|
) or is_valid_path(
|
|
1792
2006
|
self.attrs,
|
|
1793
|
-
f"{Services.
|
|
2007
|
+
f"{Services.MEASUREMENTS}.fuelLevelStatus.value.currentCngLevel_pct",
|
|
1794
2008
|
)
|
|
1795
2009
|
|
|
1796
2010
|
@property
|
|
@@ -3310,6 +3524,33 @@ class Vehicle:
|
|
|
3310
3524
|
find_path(self.attrs, f"{Services.TRIP_LAST}.averageFuelConsumption")
|
|
3311
3525
|
) in (float, int)
|
|
3312
3526
|
|
|
3527
|
+
@property
|
|
3528
|
+
def trip_last_average_gas_consumption(self):
|
|
3529
|
+
"""Return last trip average gas consumption.
|
|
3530
|
+
|
|
3531
|
+
:return:
|
|
3532
|
+
"""
|
|
3533
|
+
return float(
|
|
3534
|
+
find_path(self.attrs, f"{Services.TRIP_LAST}.averageGasConsumption")
|
|
3535
|
+
)
|
|
3536
|
+
|
|
3537
|
+
@property
|
|
3538
|
+
def trip_last_average_gas_consumption_last_updated(self) -> datetime:
|
|
3539
|
+
"""Return last updated timestamp."""
|
|
3540
|
+
return find_path(self.attrs, f"{Services.TRIP_LAST}.tripEndTimestamp")
|
|
3541
|
+
|
|
3542
|
+
@property
|
|
3543
|
+
def is_trip_last_average_gas_consumption_supported(self) -> bool:
|
|
3544
|
+
"""Return true if supported.
|
|
3545
|
+
|
|
3546
|
+
:return:
|
|
3547
|
+
"""
|
|
3548
|
+
return is_valid_path(
|
|
3549
|
+
self.attrs, f"{Services.TRIP_LAST}.averageGasConsumption"
|
|
3550
|
+
) and type(
|
|
3551
|
+
find_path(self.attrs, f"{Services.TRIP_LAST}.averageGasConsumption")
|
|
3552
|
+
) in (float, int)
|
|
3553
|
+
|
|
3313
3554
|
@property
|
|
3314
3555
|
def trip_last_average_auxillary_consumption(self):
|
|
3315
3556
|
"""Return last trip average auxiliary consumption.
|
|
@@ -3695,6 +3936,28 @@ class Vehicle:
|
|
|
3695
3936
|
|
|
3696
3937
|
return engine_type in ENGINE_TYPE_COMBUSTION
|
|
3697
3938
|
|
|
3939
|
+
def is_primary_drive_gas(self):
|
|
3940
|
+
"""Check if primary engine is gas."""
|
|
3941
|
+
if is_valid_path(
|
|
3942
|
+
self.attrs, f"{Services.FUEL_STATUS}.rangeStatus.value.carType"
|
|
3943
|
+
):
|
|
3944
|
+
return (
|
|
3945
|
+
find_path(
|
|
3946
|
+
self.attrs, f"{Services.FUEL_STATUS}.rangeStatus.value.carType"
|
|
3947
|
+
)
|
|
3948
|
+
== ENGINE_TYPE_GAS
|
|
3949
|
+
)
|
|
3950
|
+
if is_valid_path(
|
|
3951
|
+
self.attrs, f"{Services.MEASUREMENTS}.fuelLevelStatus.value.carType"
|
|
3952
|
+
):
|
|
3953
|
+
return (
|
|
3954
|
+
find_path(
|
|
3955
|
+
self.attrs, f"{Services.MEASUREMENTS}.fuelLevelStatus.value.carType"
|
|
3956
|
+
)
|
|
3957
|
+
== ENGINE_TYPE_GAS
|
|
3958
|
+
)
|
|
3959
|
+
return False
|
|
3960
|
+
|
|
3698
3961
|
@property
|
|
3699
3962
|
def is_car_type_electric(self):
|
|
3700
3963
|
"""Check if car type is electric."""
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
volkswagencarnet/__init__.py,sha256=ndlRBXCUPW7GKbbf-RdChs3xD61yE1c6aNxoYBXDBtQ,39
|
|
2
|
+
volkswagencarnet/version.py,sha256=6sTwzE4MPXepQ3uVOi2FiA6etyIANxEdW0rjjCB9S7U,413
|
|
3
|
+
volkswagencarnet/vw_connection.py,sha256=m4Nu6WW6FZspmdQGlXi_5RDfZdkJkSflJb-yZR23rKk,45931
|
|
4
|
+
volkswagencarnet/vw_const.py,sha256=aE45XXuKpQxQS4_keoUD3kZBGu8jycdhm3E009XLF6c,4002
|
|
5
|
+
volkswagencarnet/vw_dashboard.py,sha256=Os-CK5YRIqmZZ_bsxg9AyA15Z071kudorC0qkJG55A8,50075
|
|
6
|
+
volkswagencarnet/vw_utilities.py,sha256=prdIyuU5yvs4PzSabzgqJOsGL-ApGDnyvIZlJZg7DYY,3559
|
|
7
|
+
volkswagencarnet/vw_vehicle.py,sha256=ReSfyW4s4B1P_RxfexKAsro4t4VA16RVzBNnXcnrEWU,154945
|
|
8
|
+
volkswagencarnet-5.0.0b3.dist-info/LICENSE.txt,sha256=5roVEYR3e-kTlq73yMQgO18VDR4w4JiSKdHejEJnT0s,34876
|
|
9
|
+
volkswagencarnet-5.0.0b3.dist-info/METADATA,sha256=bjr3NnpL35JcUOMjZ-8PSINQ4XkTUrpgmsFYWmRxFck,6458
|
|
10
|
+
volkswagencarnet-5.0.0b3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
11
|
+
volkswagencarnet-5.0.0b3.dist-info/top_level.txt,sha256=tUJNf33PP5Ln_Zc9N86ThKbe8BKJmW60ZKABmfZL_18,17
|
|
12
|
+
volkswagencarnet-5.0.0b3.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
volkswagencarnet/__init__.py,sha256=ndlRBXCUPW7GKbbf-RdChs3xD61yE1c6aNxoYBXDBtQ,39
|
|
2
|
-
volkswagencarnet/version.py,sha256=wQJgMYgonelMpVYUYEG2aNln4UadC6obUksEET0lQiM,413
|
|
3
|
-
volkswagencarnet/vw_connection.py,sha256=m4Nu6WW6FZspmdQGlXi_5RDfZdkJkSflJb-yZR23rKk,45931
|
|
4
|
-
volkswagencarnet/vw_const.py,sha256=aE45XXuKpQxQS4_keoUD3kZBGu8jycdhm3E009XLF6c,4002
|
|
5
|
-
volkswagencarnet/vw_dashboard.py,sha256=AQ1xLvV2xvj6f__z67g8aKMh7CdBz2A8doH_-FHS4ts,49000
|
|
6
|
-
volkswagencarnet/vw_utilities.py,sha256=prdIyuU5yvs4PzSabzgqJOsGL-ApGDnyvIZlJZg7DYY,3559
|
|
7
|
-
volkswagencarnet/vw_vehicle.py,sha256=gLNpvgUaDIKKLE2JsTpTsen-rXoIXjlT8m31XnpdYEc,146387
|
|
8
|
-
volkswagencarnet-5.0.0b1.dist-info/LICENSE.txt,sha256=5roVEYR3e-kTlq73yMQgO18VDR4w4JiSKdHejEJnT0s,34876
|
|
9
|
-
volkswagencarnet-5.0.0b1.dist-info/METADATA,sha256=g6ZzbOuCpWFuWsnJ7KQlP805QNalky5SnU2i52Qo6g4,6458
|
|
10
|
-
volkswagencarnet-5.0.0b1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
11
|
-
volkswagencarnet-5.0.0b1.dist-info/top_level.txt,sha256=tUJNf33PP5Ln_Zc9N86ThKbe8BKJmW60ZKABmfZL_18,17
|
|
12
|
-
volkswagencarnet-5.0.0b1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|