From d4a39974caa9b75a1eeb1f2dc525e89d37f5364a Mon Sep 17 00:00:00 2001 From: trancefam Date: Sat, 30 Jan 2021 14:42:19 -0500 Subject: [PATCH 1/2] fix syntax error --- custom_components/ledfxrm/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ledfxrm/light.py b/custom_components/ledfxrm/light.py index e341f1d..cb05fde 100644 --- a/custom_components/ledfxrm/light.py +++ b/custom_components/ledfxrm/light.py @@ -182,7 +182,7 @@ def friendly_name(self): @property def icon(self): """Return the icon of this light.""" - if self.deviceconfig.has_key("icon_name") + if self.deviceconfig.has_key("icon_name"): if self.deviceconfig["icon_name"].startswith("mdi:"): return self.deviceconfig["icon_name"] else: From 7b9dbe81c8afd0f413bd039e54bfea2a37088597 Mon Sep 17 00:00:00 2001 From: trancefam Date: Sat, 30 Jan 2021 15:24:26 -0500 Subject: [PATCH 2/2] change attribute lookup from has_key to in --- custom_components/ledfxrm/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ledfxrm/light.py b/custom_components/ledfxrm/light.py index cb05fde..e4690a4 100644 --- a/custom_components/ledfxrm/light.py +++ b/custom_components/ledfxrm/light.py @@ -182,7 +182,7 @@ def friendly_name(self): @property def icon(self): """Return the icon of this light.""" - if self.deviceconfig.has_key("icon_name"): + if "icon_name" in self.deviceconfig: if self.deviceconfig["icon_name"].startswith("mdi:"): return self.deviceconfig["icon_name"] else: