Skip to content

Commit

Permalink
Added support for the 'UNAVAILABLE' status
Browse files Browse the repository at this point in the history
  • Loading branch information
sockless-coding committed Feb 20, 2021
1 parent 7b9120c commit 11aa196
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions custom_components/garo_wallbox/garo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Status(Enum):
VENT_FAULT = 'VENT_FAULT'
DC_ERROR = 'DC_ERROR'
UNKNOWN = 'UNKNOWN'
UNAVAILABLE = 'UNAVAILABLE'

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30)

Expand Down
6 changes: 4 additions & 2 deletions custom_components/garo_wallbox/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def icon(self):
Status.OVERHEAT: "mdi:alert",
Status.RCD_FAULT: "mdi:alert",
Status.SEARCH_COMM: "mdi:help",
Status.VENT_FAULT: "mdi:alert"
Status.VENT_FAULT: "mdi:alert",
Status.UNAVAILABLE: "mdi:alert"
}
icon = switcher.get(self._device.status.status, None)
elif self._sensor == "nr_of_phases":
Expand Down Expand Up @@ -209,7 +210,8 @@ def status_as_str(self):
Status.OVERHEAT: "Overtemperature, charging temporarily restricted to 6A",
Status.RCD_FAULT: "RCD fault",
Status.SEARCH_COMM: "Vehicle connected",
Status.VENT_FAULT: "Ventilation required"
Status.VENT_FAULT: "Ventilation required",
Status.UNAVAILABLE: "Unavailable"
}
return switcher.get(self._device.status.status, "Unknown")

0 comments on commit 11aa196

Please sign in to comment.