Added decorate option to configuration file to allow a user to set custom images for different entities.
This commit is contained in:
1 parent
24bb89df23
commit
f77b3dbd0a
3 files changed
+22
-10
No files matched your search
@@ -24,7 +24,8 @@ from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import (
|
||||
EVENT_COMPONENT_LOADED, CONF_LATITUDE, CONF_LONGITUDE,
|
||||
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, CONF_VISIBILITY,
|
||||
TEMP_CELCIUS, TEMP_FAHRENHEIT)
|
||||
CONF_DECORATE, TEMP_CELCIUS, TEMP_FAHRENHEIT, ATTR_ENTITY_PICTURE,
|
||||
ATTR_HIDDEN)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -209,7 +210,10 @@ def process_ha_core_config(hass, config):
|
||||
setattr(hass.config, attr, config[key])
|
||||
|
||||
for entity_id, hidden in config.get(CONF_VISIBILITY, {}).items():
|
||||
Entity.overwrite_hidden(entity_id, hidden == 'hide')
|
||||
Entity.overwrite_attribute(entity_id, ATTR_HIDDEN, hidden == 'hide')
|
||||
|
||||
for entity_id, image in config.get(CONF_DECORATE, {}).items():
|
||||
Entity.overwrite_attribute(entity_id, ATTR_ENTITY_PICTURE, image)
|
||||
|
||||
if CONF_TEMPERATURE_UNIT in config:
|
||||
unit = config[CONF_TEMPERATURE_UNIT]
|
||||
|
||||
Reference in new issue
Block a user