mirror of
https://github.com/andvikt/mega_hacs.git
synced 2026-02-02 23:47:47 +05:00
add fill_na
This commit is contained in:
@@ -130,7 +130,6 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
|
|||||||
if self.hass is None or self.entity_id is None:
|
if self.hass is None or self.entity_id is None:
|
||||||
return {}
|
return {}
|
||||||
if self._customize is None:
|
if self._customize is None:
|
||||||
|
|
||||||
c_entity_id = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM).get('entities', {}).get(self.entity_id, {})
|
c_entity_id = self.hass.data.get(DOMAIN, {}).get(CONF_CUSTOM).get('entities', {}).get(self.entity_id, {})
|
||||||
self.lg.debug(
|
self.lg.debug(
|
||||||
'customize %s with %s', self.entity_id, c_entity_id
|
'customize %s with %s', self.entity_id, c_entity_id
|
||||||
|
|||||||
@@ -324,7 +324,10 @@ class Mega1WSensor(FilterBadValues):
|
|||||||
n = super().name
|
n = super().name
|
||||||
c = self.customize.get(CONF_NAME, {})
|
c = self.customize.get(CONF_NAME, {})
|
||||||
if isinstance(c, dict):
|
if isinstance(c, dict):
|
||||||
c = c.get(self.key)
|
try:
|
||||||
|
c = c.get(self.key)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return c or n
|
return c or n
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user