Tweak visibility config

This commit is contained in:
Paulus Schoutsen 2015-04-23 06:41:41 -07:00
parent bbdb0320f1
commit b855f422ef
4 changed files with 103 additions and 40 deletions

View file

@ -20,11 +20,11 @@ import homeassistant
import homeassistant.loader as loader
import homeassistant.components as core_components
import homeassistant.components.group as group
from homeassistant.helpers.entity import VisibilityABC
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, TEMP_CELCIUS,
TEMP_FAHRENHEIT)
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, CONF_VISIBILITY,
TEMP_CELCIUS, TEMP_FAHRENHEIT)
_LOGGER = logging.getLogger(__name__)
@ -208,7 +208,8 @@ def process_ha_core_config(hass, config):
if key in config:
setattr(hass.config, attr, config[key])
VisibilityABC.visibility.update(config.get('visibility', {}))
for entity_id, hidden in config.get(CONF_VISIBILITY, {}).items():
Entity.overwrite_hidden(entity_id, hidden == 'hide')
if CONF_TEMPERATURE_UNIT in config:
unit = config[CONF_TEMPERATURE_UNIT]