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
1 changed files with 10 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue