Skip to content

Commit

Permalink
Sensor icons and example image
Browse files Browse the repository at this point in the history
  • Loading branch information
sockless-coding committed May 16, 2020
1 parent 2889aeb commit e46a7bd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This is a custom component to allow control of Garo Wallboxes in [HomeAssistant](https://home-assistant.io).

![Example entities](https://github.com/sockless-coding/garo_wallbox/raw/master/doc/entities.png)

#### Support Development
- :coffee:  [Buy me a coffee](https://www.buymeacoffee.com/sockless)

Expand Down
31 changes: 30 additions & 1 deletion custom_components/garo_wallbox/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,36 @@ def icon(self):
icon = "mdi:flash"
elif self._sensor == "pilot_level":
icon = "mdi:flash"

elif self._sensor == "acc_session_energy":
icon = "mdi:flash"
elif self._sensor == "latest_reading":
icon = "mdi:flash"
elif self._sensor == "status":
switcher = {
Status.CABLE_FAULT: "mdi:alert",
Status.CHANGING: "mdi:update",
Status.CHARGING: "mdi:battery-charging",
Status.CHARGING_CANCELLED: "mdi:cancel",
Status.CHARGING_FINISHED: "mdi:battery",
Status.CHARGING_PAUSED: "mdi:pause",
Status.CONNECTED: "mdi:power-plug",
Status.CONTACTOR_FAULT: "mdi:alert",
Status.CRITICAL_TEMPERATURE: "mdi:alert",
Status.DC_ERROR: "mdi:alert",
Status.INITIALIZATION: "mdi:timer-sand",
Status.LOCK_FAULT: "mdi:alert",
Status.NOT_CONNECTED: "mdi:power-plug-off",
Status.OVERHEAT: "mdi:alert",
Status.RCD_FAULT: "mdi:alert",
Status.SEARCH_COMM: "mdi:help",
Status.VENT_FAULT: "mdi:alert"
}
icon = switcher.get(self._device.status.status, None)
elif self._sensor == "nr_of_phases":
if self.state == 1:
icon = "mdi:record-circle-outline"
else:
icon = "mdi:google-circles-communities"
return icon

@property
Expand Down
Binary file added docs/entities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This is a custom component to allow control of Garo Wallboxes in [HomeAssistant](https://home-assistant.io).

![Example entities](https://github.com/sockless-coding/garo_wallbox/raw/master/doc/entities.png)

#### Support Development
- :coffee:  [Buy me a coffee](https://www.buymeacoffee.com/sockless)

Expand Down

0 comments on commit e46a7bd

Please sign in to comment.