mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 23:37:18 +00:00
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 <goran.johansson@shiftit.se> * black formatting --------- Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
parent
7f616b0d44
commit
8bef39a2fb
@ -54,11 +54,16 @@ class WallboxSwitch(WallboxEntity, SwitchEntity):
|
|||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return the availability of the switch."""
|
"""Return the availability of the switch."""
|
||||||
return self.coordinator.data[CHARGER_STATUS_DESCRIPTION_KEY] in {
|
return super().available and self.coordinator.data[
|
||||||
ChargerStatus.CHARGING,
|
CHARGER_STATUS_DESCRIPTION_KEY
|
||||||
ChargerStatus.DISCHARGING,
|
] not in {
|
||||||
ChargerStatus.PAUSED,
|
ChargerStatus.UNKNOWN,
|
||||||
ChargerStatus.SCHEDULED,
|
ChargerStatus.UPDATING,
|
||||||
|
ChargerStatus.ERROR,
|
||||||
|
ChargerStatus.LOCKED,
|
||||||
|
ChargerStatus.LOCKED_CAR_CONNECTED,
|
||||||
|
ChargerStatus.DISCONNECTED,
|
||||||
|
ChargerStatus.READY,
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user