mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Added decorate option to configuration file to allow a user to set custom images for different entities.
This commit is contained in:
@@ -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