Allow HomeKit name to be customized (#14159)
This commit is contained in:
parent
48d70e520f
commit
621c653fed
20 changed files with 97 additions and 79 deletions
|
@ -5,7 +5,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.core import split_entity_id
|
||||
from homeassistant.const import (
|
||||
ATTR_CODE, TEMP_CELSIUS)
|
||||
ATTR_CODE, CONF_NAME, TEMP_CELSIUS)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.temperature as temp_util
|
||||
from .const import HOMEKIT_NOTIFY_ID
|
||||
|
@ -16,13 +16,18 @@ _LOGGER = logging.getLogger(__name__)
|
|||
def validate_entity_config(values):
|
||||
"""Validate config entry for CONF_ENTITY."""
|
||||
entities = {}
|
||||
for key, config in values.items():
|
||||
entity = cv.entity_id(key)
|
||||
for entity_id, config in values.items():
|
||||
entity = cv.entity_id(entity_id)
|
||||
params = {}
|
||||
if not isinstance(config, dict):
|
||||
raise vol.Invalid('The configuration for "{}" must be '
|
||||
' an dictionary.'.format(entity))
|
||||
|
||||
for key in (CONF_NAME, ):
|
||||
value = config.get(key, -1)
|
||||
if value != -1:
|
||||
params[key] = cv.string(value)
|
||||
|
||||
domain, _ = split_entity_id(entity)
|
||||
|
||||
if domain == 'alarm_control_panel':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue