Skip to content

Commit

Permalink
Update audi_connect_account.py
Browse files Browse the repository at this point in the history
Added plugLockState, externalPower, plugledColor
  • Loading branch information
Ingrimmsch93 authored Mar 4, 2024
1 parent 38425da commit 86c2608
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions custom_components/audiconnect/audi_connect_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,15 @@ async def update_vehicle_charger(self):
self._vehicle.state["plugState"] = get_attr(
result, "charger.status.plugStatusData.plugState.content"
)
self._vehicle.state["plugLockState"] = get_attr(
result, "charger.status.plugStatusData.plugLockState.content"
)
self._vehicle.state["externalPower"] = get_attr(
result, "charger.status.plugStatusData.externalPower.content"
)
self._vehicle.state["plugledColor"] = get_attr(
result, "charger.status.plugStatusData.plugledColor.content"
)

except TimeoutError:
raise
Expand Down Expand Up @@ -1379,6 +1388,42 @@ def plug_state_supported(self):
if check:
return True

@property
def plug_lock_state(self):
"""Return plug lock state"""
if self.plug_lock_state_supported:
return self._vehicle.state.get("plugLockState")

@property
def plug_lock_state_supported(self):
check = self._vehicle.state.get("plugLockState")
if check:
return True

@property
def external_power(self):
"""Return external Power"""
if self.external_power_supported:
return self._vehicle.state.get("externalPower")

@property
def external_power_supported(self):
check = self._vehicle.state.get("externalPower")
if check:
return True

@property
def plug_led_color(self):
"""Return plug LED Color"""
if self.plug_led_color_supported:
return self._vehicle.state.get("plugledColor")

@property
def plug_led_color_supported(self):
check = self._vehicle.state.get("plugledColor")
if check:
return True

@property
def climatisation_state(self):
if self.climatisation_state_supported:
Expand Down

0 comments on commit 86c2608

Please sign in to comment.