From 55a0f08a0a53dff439e09f0b952a039a04c79ccc Mon Sep 17 00:00:00 2001 From: Matthieu Date: Sun, 27 Oct 2019 16:37:24 +0100 Subject: [PATCH] Change swith to lock icon --- custom_components/georide/__init__.py | 3 +++ custom_components/georide/switch.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/custom_components/georide/__init__.py b/custom_components/georide/__init__.py index d7c3fcf..f12edf4 100644 --- a/custom_components/georide/__init__.py +++ b/custom_components/georide/__init__.py @@ -129,3 +129,6 @@ class GeorideContext: """ here we return the current valid tocken, TODO: add here token expiration control""" return self._token + async def async_update(self): + """ update the current tracker""" + _LOGGER.info('async_update ') \ No newline at end of file diff --git a/custom_components/georide/switch.py b/custom_components/georide/switch.py index 883ab05..c091088 100644 --- a/custom_components/georide/switch.py +++ b/custom_components/georide/switch.py @@ -94,6 +94,12 @@ class GeorideLockSwitchEntity(SwitchDevice): """ Georide switch token callback method """ return self._token_callback + @property + def icon(self): + if self._is_on: + return "mdi:lock" + return "mdi:lock-open" + @property def device_info(self):