From 8bef39a2fb70da62db4201ee5ee830daf76b6804 Mon Sep 17 00:00:00 2001 From: Hessel Date: Fri, 11 Aug 2023 16:39:29 +0200 Subject: [PATCH] Wallbox Integration Change Switch Availability (#98111) * change switch availability * remove new test * Update homeassistant/components/wallbox/switch.py Also check super availability. Co-authored-by: G Johansson * black formatting --------- Co-authored-by: G Johansson --- homeassistant/components/wallbox/switch.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/wallbox/switch.py b/homeassistant/components/wallbox/switch.py index 3d046d5d241..7a0736f59e7 100644 --- a/homeassistant/components/wallbox/switch.py +++ b/homeassistant/components/wallbox/switch.py @@ -54,11 +54,16 @@ class WallboxSwitch(WallboxEntity, SwitchEntity): @property def available(self) -> bool: """Return the availability of the switch.""" - return self.coordinator.data[CHARGER_STATUS_DESCRIPTION_KEY] in { - ChargerStatus.CHARGING, - ChargerStatus.DISCHARGING, - ChargerStatus.PAUSED, - ChargerStatus.SCHEDULED, + return super().available and self.coordinator.data[ + CHARGER_STATUS_DESCRIPTION_KEY + ] not in { + ChargerStatus.UNKNOWN, + ChargerStatus.UPDATING, + ChargerStatus.ERROR, + ChargerStatus.LOCKED, + ChargerStatus.LOCKED_CAR_CONNECTED, + ChargerStatus.DISCONNECTED, + ChargerStatus.READY, } @property