From 2a4a85a20e2f5ee9109dea0d6e7374ca7fef4de5 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 22 Jan 2021 11:12:18 +0300 Subject: [PATCH] small bugfix --- custom_components/mega/entities.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/mega/entities.py b/custom_components/mega/entities.py index 020c0ac..bf2567e 100644 --- a/custom_components/mega/entities.py +++ b/custom_components/mega/entities.py @@ -41,7 +41,10 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity): if self.hass is None: return {} if self._customize is None: - self._customize = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM, {}).get(self._mega_id).get(self.port, {}) + c = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM) or {} + c = c.get(self._mega_id) or {} + c = c.get(self.port) or {} + self._customize = c return self._customize @property