ESPHome  2024.10.2
delonghi.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace esphome {
6 namespace delonghi {
7 
8 // Values for DELONGHI ARC43XXX IR Controllers
9 const uint8_t DELONGHI_ADDRESS = 83;
10 
11 // Temperature
12 const uint8_t DELONGHI_TEMP_MIN = 13; // Celsius
13 const uint8_t DELONGHI_TEMP_MAX = 32; // Celsius
14 const uint8_t DELONGHI_TEMP_OFFSET_COOL = 17; // Celsius
15 const uint8_t DELONGHI_TEMP_OFFSET_HEAT = 12; // Celsius
16 
17 // Modes
18 const uint8_t DELONGHI_MODE_AUTO = 0b1000;
19 const uint8_t DELONGHI_MODE_COOL = 0b0000;
20 const uint8_t DELONGHI_MODE_HEAT = 0b0110;
21 const uint8_t DELONGHI_MODE_DRY = 0b0010;
22 const uint8_t DELONGHI_MODE_FAN = 0b0100;
23 const uint8_t DELONGHI_MODE_OFF = 0b0000;
24 const uint8_t DELONGHI_MODE_ON = 0b0001;
25 
26 // Fan Speed
27 const uint8_t DELONGHI_FAN_AUTO = 0b00;
28 const uint8_t DELONGHI_FAN_HIGH = 0b01;
29 const uint8_t DELONGHI_FAN_MEDIUM = 0b10;
30 const uint8_t DELONGHI_FAN_LOW = 0b11;
31 
32 // IR Transmission - similar to NEC1
33 const uint32_t DELONGHI_IR_FREQUENCY = 38000;
34 const uint32_t DELONGHI_HEADER_MARK = 9000;
35 const uint32_t DELONGHI_HEADER_SPACE = 4500;
36 const uint32_t DELONGHI_BIT_MARK = 465;
37 const uint32_t DELONGHI_ONE_SPACE = 1750;
38 const uint32_t DELONGHI_ZERO_SPACE = 670;
39 
40 // State Frame size
41 const uint8_t DELONGHI_STATE_FRAME_SIZE = 8;
42 
44  public:
46  : climate_ir::ClimateIR(DELONGHI_TEMP_MIN, DELONGHI_TEMP_MAX, 1.0f, true, true,
51 
52  protected:
53  // Transmit via IR the state of this climate controller.
54  void transmit_state() override;
55  uint8_t operation_mode_();
56  uint16_t fan_speed_();
57  uint8_t temperature_();
58  // Handle received IR Buffer
59  bool on_receive(remote_base::RemoteReceiveData data) override;
60  bool parse_state_frame_(const uint8_t frame[]);
61 };
62 
63 } // namespace delonghi
64 } // namespace esphome
The fan mode is set to Low.
Definition: climate_mode.h:54
The fan mode is set to Both.
Definition: climate_mode.h:74
const uint32_t DELONGHI_IR_FREQUENCY
Definition: delonghi.h:33
bool parse_state_frame_(const uint8_t frame[])
Definition: delonghi.cpp:105
const uint32_t DELONGHI_ONE_SPACE
Definition: delonghi.h:37
const uint8_t DELONGHI_ADDRESS
Definition: delonghi.h:9
const uint8_t DELONGHI_TEMP_MIN
Definition: delonghi.h:12
const uint8_t DELONGHI_FAN_MEDIUM
Definition: delonghi.h:29
const uint32_t DELONGHI_BIT_MARK
Definition: delonghi.h:36
const uint8_t DELONGHI_TEMP_OFFSET_HEAT
Definition: delonghi.h:15
const uint32_t DELONGHI_HEADER_MARK
Definition: delonghi.h:34
The fan mode is set to Horizontal.
Definition: climate_mode.h:78
The fan mode is set to Auto.
Definition: climate_mode.h:52
const uint8_t DELONGHI_FAN_LOW
Definition: delonghi.h:30
const uint8_t DELONGHI_FAN_HIGH
Definition: delonghi.h:28
const uint8_t DELONGHI_TEMP_OFFSET_COOL
Definition: delonghi.h:14
const uint8_t DELONGHI_MODE_DRY
Definition: delonghi.h:21
const uint8_t DELONGHI_MODE_OFF
Definition: delonghi.h:23
const uint32_t DELONGHI_ZERO_SPACE
Definition: delonghi.h:38
const uint32_t DELONGHI_HEADER_SPACE
Definition: delonghi.h:35
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, std::set< climate::ClimateFanMode > fan_modes={}, std::set< climate::ClimateSwingMode > swing_modes={}, std::set< climate::ClimatePreset > presets={})
Definition: climate_ir.h:26
The fan mode is set to Vertical.
Definition: climate_mode.h:76
bool on_receive(remote_base::RemoteReceiveData data) override
Definition: delonghi.cpp:160
const uint8_t DELONGHI_MODE_ON
Definition: delonghi.h:24
The fan mode is set to High.
Definition: climate_mode.h:58
The swing mode is set to Off.
Definition: climate_mode.h:72
const uint8_t DELONGHI_TEMP_MAX
Definition: delonghi.h:13
const uint8_t DELONGHI_MODE_HEAT
Definition: delonghi.h:20
const uint8_t DELONGHI_MODE_COOL
Definition: delonghi.h:19
const uint8_t DELONGHI_FAN_AUTO
Definition: delonghi.h:27
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
const uint8_t DELONGHI_MODE_AUTO
Definition: delonghi.h:18
The fan mode is set to Medium.
Definition: climate_mode.h:56
const uint8_t DELONGHI_MODE_FAN
Definition: delonghi.h:22
const uint8_t DELONGHI_STATE_FRAME_SIZE
Definition: delonghi.h:41