1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Rearranged visibility control and image control in the configuration file. Now a single generic clause can be used to customize any attribute.

This commit is contained in:
Ryan Kraus
2015-04-25 14:47:15 -04:00
parent 04a98f99b7
commit 8255164eda
4 changed files with 24 additions and 26 deletions

View File

@@ -23,9 +23,8 @@ import homeassistant.components.group as group
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,
CONF_DECORATE, TEMP_CELCIUS, TEMP_FAHRENHEIT, ATTR_ENTITY_PICTURE,
ATTR_HIDDEN)
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, CONF_CUSTOMIZE,
TEMP_CELCIUS, TEMP_FAHRENHEIT)
_LOGGER = logging.getLogger(__name__)
@@ -209,11 +208,8 @@ def process_ha_core_config(hass, config):
if key in config:
setattr(hass.config, attr, config[key])
for entity_id, hidden in config.get(CONF_VISIBILITY, {}).items():
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)
for entity_id, attrs in config.get(CONF_CUSTOMIZE, {}).items():
Entity.overwrite_attribute(entity_id, attrs.keys(), attrs.values())
if CONF_TEMPERATURE_UNIT in config:
unit = config[CONF_TEMPERATURE_UNIT]