mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 23:14:25 +01:00
Improve error handling for Entity Parsing
This commit is contained in:
@@ -6,9 +6,12 @@ HA_API = None
|
|||||||
|
|
||||||
class Entity(object):
|
class Entity(object):
|
||||||
def __init__(self, entity_input_config):
|
def __init__(self, entity_input_config):
|
||||||
self.entityId = entity_input_config.get("entity", "unknown")
|
if type(entity_input_config) is not dict:
|
||||||
self.nameOverride = entity_input_config.get("name")
|
LOGGER.error("Config error, not a dict check your entity configs")
|
||||||
self.iconOverride = entity_input_config.get("icon")
|
else:
|
||||||
|
self.entityId = entity_input_config.get("entity", "unknown")
|
||||||
|
self.nameOverride = entity_input_config.get("name")
|
||||||
|
self.iconOverride = entity_input_config.get("icon")
|
||||||
|
|
||||||
class Card(object):
|
class Card(object):
|
||||||
def __init__(self, card_input_config, pos=None):
|
def __init__(self, card_input_config, pos=None):
|
||||||
@@ -154,4 +157,4 @@ class LuiBackendConfig(object):
|
|||||||
return self._config_screensaver
|
return self._config_screensaver
|
||||||
for card in self._config_hidden_cards:
|
for card in self._config_hidden_cards:
|
||||||
if card.id == id:
|
if card.id == id:
|
||||||
return card
|
return card
|
||||||
|
|||||||
Reference in New Issue
Block a user