ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
panasonic_ir.h
Go to the documentation of this file.
1#pragma once
2
3#include <iterator>
4
6#ifdef USE_SELECT
8#endif
10
11namespace esphome::panasonic_ir {
12
13static constexpr const char *FAN_MODE_MINIMUM = "Minimum";
14static constexpr const char *FAN_MODE_MAXIMUM = "Maximum";
15static constexpr const char *const CUSTOM_FAN_MODES[] PROGMEM = {FAN_MODE_MINIMUM, FAN_MODE_MAXIMUM};
16
18 public:
20 : climate_ir::ClimateIR(TEMP_MIN, TEMP_MAX,
21 1.0f, // Temp step
22 true, // Supports dry
23 true, // Supports fan only
28 this->set_supported_custom_fan_modes_static(CUSTOM_FAN_MODES, std::size(CUSTOM_FAN_MODES));
29 }
30
31 void set_model(Model model) { this->model_ = model; }
32 void setup() override;
33 void dump_config() override;
34
36 void set_vane_position(size_t index);
37#ifdef USE_SELECT
38 SUB_SELECT(vane)
39#endif
40
41 protected:
42 void control(const climate::ClimateCall &call) override;
43
45 void transmit_state() override;
48
49 uint8_t fan_speed_() const;
50 uint8_t vane_v_() const;
51 void sync_vane_select_();
52 void apply_received_(const FrameParams &params);
53
55 // The remote has no concept of "off" mode, so remember what to send along with the power bit
57 // CKP models only have a power toggle, so we need to keep track of the state
58 bool ckp_is_on_{false};
59 // The time and second section of the last frame sent, so its echo is not taken for the remote. The time starts
60 // outside the echo window.
61 uint32_t echo_sent_ms_{UINT32_MAX / 2};
62 uint8_t echo_[SECTION2_LENGTH]{};
63 // The fixed vane position (1 to 5) used while swing is off. 0 until one is chosen, then heat blows down and the
64 // other modes up
65 uint8_t vane_position_{0};
66};
67
68} // namespace esphome::panasonic_ir
This class is used to encode all control actions on a climate device.
Definition climate.h:31
void set_supported_custom_fan_modes_static(const char *const *modes, size_t count)
Points at a static table that outlives the climate (codegen); call before any runtime copy.
Definition climate.h:265
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
void apply_received_(const FrameParams &params)
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR buffer.
void set_vane_position(size_t index)
Set the vertical vane from the select: 0 is auto (swing vertical), 1 (highest) to 5 (lowest) are fixe...
SUB_SELECT(vane) protected void transmit_state() override
Transmit via IR the state of this climate controller.
constexpr float BME680_GAS_LOOKUP_TABLE_1[16] PROGMEM
Definition bme680.cpp:28
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_PRESET_AWAY
Device is in away preset.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
static void uint32_t