From 5c56f15c6774910234dfb1b22493c26ae2d6c910 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 5 Nov 2019 22:27:35 +0100 Subject: [PATCH] Fix homeassistant.service schema lambda (#833) * Fix homeassistant.service schema lambda Fixes https://github.com/esphome/issues/issues/820 * Improve * Fix --- esphome/components/api/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/api/__init__.py b/esphome/components/api/__init__.py index 43c7d71e74..a0568863ad 100644 --- a/esphome/components/api/__init__.py +++ b/esphome/components/api/__init__.py @@ -70,14 +70,14 @@ def to_code(config): cg.add_global(api_ns.using) -KEY_VALUE_SCHEMA = cv.Schema({cv.string: cv.templatable(cv.string)}) +KEY_VALUE_SCHEMA = cv.Schema({cv.string: cv.templatable(cv.string_strict)}) HOMEASSISTANT_SERVICE_ACTION_SCHEMA = cv.Schema({ cv.GenerateID(): cv.use_id(APIServer), cv.Required(CONF_SERVICE): cv.templatable(cv.string), cv.Optional(CONF_DATA, default={}): KEY_VALUE_SCHEMA, cv.Optional(CONF_DATA_TEMPLATE, default={}): KEY_VALUE_SCHEMA, - cv.Optional(CONF_VARIABLES, default={}): KEY_VALUE_SCHEMA, + cv.Optional(CONF_VARIABLES, default={}): cv.Schema({cv.string: cv.returning_lambda}), })