From 10cc0b1d5b2f86696219561214321c993133a3e7 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 14 Jun 2019 12:53:27 +0200 Subject: [PATCH] Fix remote_receiver raw binary sensor (#639) * Fix remote_receiver raw binary sensor Fixes https://github.com/esphome/issues/issues/439 * Lint --- esphome/components/remote_base/__init__.py | 4 ++-- tests/test1.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/esphome/components/remote_base/__init__.py b/esphome/components/remote_base/__init__.py index fa9425c434..d3da238b08 100644 --- a/esphome/components/remote_base/__init__.py +++ b/esphome/components/remote_base/__init__.py @@ -2,7 +2,7 @@ import esphome.codegen as cg import esphome.config_validation as cv from esphome import automation from esphome.components import binary_sensor -from esphome.const import CONF_DATA, CONF_ID, CONF_TRIGGER_ID, CONF_NBITS, CONF_ADDRESS, \ +from esphome.const import CONF_DATA, CONF_TRIGGER_ID, CONF_NBITS, CONF_ADDRESS, \ CONF_COMMAND, CONF_CODE, CONF_PULSE_LENGTH, CONF_SYNC, CONF_ZERO, CONF_ONE, CONF_INVERTED, \ CONF_PROTOCOL, CONF_GROUP, CONF_DEVICE, CONF_STATE, CONF_CHANNEL, CONF_FAMILY, CONF_REPEAT, \ CONF_WAIT_TIME, CONF_TIMES, CONF_TYPE_ID, CONF_CARRIER_FREQUENCY @@ -350,7 +350,7 @@ RAW_SCHEMA = cv.Schema({ @register_binary_sensor('raw', RawBinarySensor, RAW_SCHEMA) def raw_binary_sensor(var, config): code_ = config[CONF_CODE] - arr = cg.progmem_array(config[CONF_ID], code_) + arr = cg.progmem_array(config[CONF_CODE_STORAGE_ID], code_) cg.add(var.set_data(arr)) cg.add(var.set_len(len(code_))) diff --git a/tests/test1.yaml b/tests/test1.yaml index e1f0e8cb7a..fac39b6a06 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -661,6 +661,13 @@ binary_sensor: number: 1 mode: INPUT inverted: True + - platform: remote_receiver + name: "Raw Remote Receiver Test" + raw: + code: [5685, -4252, 1711, -2265, 1712, -2265, 1711, -2264, 1712, -2266, + 3700, -2263, 1712, -4254, 1711, -4249, 1715, -2266, 1710, -2267, + 1709, -2265, 3704, -4250, 1712, -4254, 3700, -2260, 1714, -2265, + 1712, -2262, 1714, -2267, 1709] pca9685: frequency: 500