From 605e36540592f9729c8a57a23c82360680202dbc Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 31 May 2019 10:36:23 +0200 Subject: [PATCH] Fix remote_receiver binary_sensor schema (#578) Fixes https://github.com/esphome/issues/issues/353#issuecomment-497491863 --- esphome/components/light/automation.py | 2 +- esphome/config_validation.py | 1 - tests/test1.yaml | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/light/automation.py b/esphome/components/light/automation.py index 41074c098d..9e14246c0f 100644 --- a/esphome/components/light/automation.py +++ b/esphome/components/light/automation.py @@ -155,6 +155,6 @@ def light_addressable_set_to_code(config, action_id, template_arg, args): automation.maybe_simple_id({ cv.Required(CONF_ID): cv.use_id(LightState), })) -def binary_sensor_is_on_to_code(config, condition_id, template_arg, args): +def light_is_on_off_to_code(config, condition_id, template_arg, args): paren = yield cg.get_variable(config[CONF_ID]) yield cg.new_Pvariable(condition_id, template_arg, paren) diff --git a/esphome/config_validation.py b/esphome/config_validation.py index 50d30c3ea6..4ec3033452 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -1175,7 +1175,6 @@ def validate_registry_entry(name, registry): if not isinstance(value, dict): raise Invalid(u"{} must consist of key-value mapping! Got {}" u"".format(name.title(), value)) - value = base_schema(value) key = next((x for x in value if x not in ignore_keys), None) if key is None: raise Invalid(u"Key missing from {}! Got {}".format(name, value)) diff --git a/tests/test1.yaml b/tests/test1.yaml index b5646762e8..d47773c6b8 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -105,6 +105,9 @@ mqtt: - light.control: id: living_room_lights brightness: !lambda 'return id(living_room_lights).current_values.get_brightness() + 0.5;' + - light.dim_relative: + id: living_room_lights + relative_brightness: 5% - uart.write: id: uart0 data: Hello World