From 86c2608a0a73e304b6ebabd812579fd63b09aa9d Mon Sep 17 00:00:00 2001 From: Ingrimmsch93 Date: Mon, 4 Mar 2024 22:26:09 +0100 Subject: [PATCH] Update audi_connect_account.py Added plugLockState, externalPower, plugledColor --- .../audiconnect/audi_connect_account.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/custom_components/audiconnect/audi_connect_account.py b/custom_components/audiconnect/audi_connect_account.py index 904f6da6..82d83e34 100644 --- a/custom_components/audiconnect/audi_connect_account.py +++ b/custom_components/audiconnect/audi_connect_account.py @@ -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 @@ -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: