Skip to content

Commit

Permalink
Update audi_models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DivingUp authored Mar 3, 2024
1 parent 9214fa4 commit 7a4440c
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions custom_components/audiconnect/audi_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,26 @@ def __init__(self, data):

self.appendWindowState(data)
self.appendDoorState(data)



#self.states.append({"name" : "engineTypeFirstEngine", "value" : data["fuelStatus"]["rangeStatus"]["value"]["primaryEngine"]["type"]})
#self.states.append({"name" : "primaryEngineRange", "value" : data["fuelStatus"]["rangeStatus"]["value"]["primaryEngine"]["remainingRange_km"]})

if 'primaryEngine' in data["fuelStatus"]["rangeStatus"]["value"]:
self.states.append({"name" : "carType", "value" : data["fuelStatus"]["rangeStatus"]["value"]["carType"]})
self.states.append({"name" : "engineTypeFirstEngine", "value" : data["fuelStatus"]["rangeStatus"]["value"]["primaryEngine"]["type"]})
self.states.append({"name" : "primaryEngineRange", "value" : data["fuelStatus"]["rangeStatus"]["value"]["primaryEngine"]["remainingRange_km"]})
self.states.append({"name" : "primaryEngineRangePercent", "value" : data["fuelStatus"]["rangeStatus"]["value"]["primaryEngine"]["currentSOC_pct"]})
else:
print("No Primary Engine")



if 'secondaryEngine' in data["fuelStatus"]["rangeStatus"]["value"]:
self.states.append({"name" : "engineTypeSecondEngine", "value" : data["fuelStatus"]["rangeStatus"]["value"]["secondaryEngine"]["type"]})
self.states.append({"name" : "secondaryEngineRange", "value" : data["fuelStatus"]["rangeStatus"]["value"]["secondaryEngine"]["remainingRange_km"]})
self.states.append({"name" : "secondaryEngineRangePercent", "value" : data["fuelStatus"]["rangeStatus"]["value"]["secondaryEngine"]["currentSOC_pct"]})
else:
print("No Secondary Engine")

if 'charging' in data:
self.states.append({"name" : "actualChargeRate", "value" : data["charging"]["chargingStatus"]["value"]["chargeRate_kmph"]})
self.states.append({"name" : "chargingPower", "value" : data["charging"]["chargingStatus"]["value"]["chargePower_kW"]})
Expand Down

0 comments on commit 7a4440c

Please sign in to comment.