From 84accb6df68a3370403e639ddc93b44d32847ba9 Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Tue, 3 Dec 2019 11:50:06 -0300 Subject: [PATCH] fix climate_ir on receive optional (#897) * fix climate on receive optional * add climate tests --- esphome/components/climate_ir/climate_ir.h | 3 +++ tests/test1.yaml | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/esphome/components/climate_ir/climate_ir.h b/esphome/components/climate_ir/climate_ir.h index b4c036f3d6..024010f00c 100644 --- a/esphome/components/climate_ir/climate_ir.h +++ b/esphome/components/climate_ir/climate_ir.h @@ -44,6 +44,9 @@ class ClimateIR : public climate::Climate, public Component, public remote_base: /// Transmit via IR the state of this climate controller. virtual void transmit_state() = 0; + // Dummy implement on_receive so implementation is optional for inheritors + bool on_receive(remote_base::RemoteReceiveData data) override { return false; }; + bool supports_cool_{true}; bool supports_heat_{true}; diff --git a/tests/test1.yaml b/tests/test1.yaml index 66f0220836..6cf7d8e329 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -618,7 +618,7 @@ sensor: name: "Windspeed" wind_direction_degrees: name: "Winddirection Degrees" - pin: + pin: number: GPIO04 mode: INPUT - platform: zyaura @@ -1033,7 +1033,7 @@ light: name: "Test For Custom Lambda Effect" lambda: |- it[0] = current_color; - + - automation: name: Custom Effect sequence: @@ -1105,6 +1105,11 @@ climate: sensor: my_sensor - platform: coolix name: Coolix Climate + - platform: fujitsu_general + name: Fujitsu General Climate + - platform: yashima + name: Yashima Climate + switch: - platform: gpio @@ -1302,7 +1307,7 @@ interval: static uint16_t btn_left_state = id(btn_left)->get_value(); ESP_LOGD("adaptive touch", "___ Touch Pad '%s' (T%u): val: %u state: %u tres:%u", id(btn_left)->get_name().c_str(), id(btn_left)->get_touch_pad(), id(btn_left)->get_value(), btn_left_state, id(btn_left)->get_threshold()); - + btn_left_state = ((uint32_t) id(btn_left)->get_value() + 63 * (uint32_t)btn_left_state) >> 6; id(btn_left)->set_threshold(btn_left_state * 0.9);