ESPHome  2024.3.2
whynter.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <cinttypes>
6 
7 namespace esphome {
8 namespace whynter {
9 
10 // Temperature
11 const uint8_t TEMP_MIN_C = 16; // Celsius
12 const uint8_t TEMP_MAX_C = 32; // Celsius
13 const uint8_t TEMP_MIN_F = 61; // Fahrenheit
14 const uint8_t TEMP_MAX_F = 89; // Fahrenheit
15 
17  public:
19  : climate_ir::ClimateIR(TEMP_MIN_C, TEMP_MAX_C, 1.0, true, true,
21 
24 
25  // Set use of Fahrenheit units
26  void set_fahrenheit(bool value) {
27  this->fahrenheit_ = value;
28  this->temperature_step_ = 1.0f;
31  }
32 
33  protected:
35  void transmit_state() override;
37  bool on_receive(remote_base::RemoteReceiveData data) override;
38 
39  void transmit_(uint32_t value);
40 
41  uint32_t header_high_ = 8000;
42  uint32_t header_low_ = 4000;
43  uint32_t bit_high_ = 600;
44  uint32_t bit_one_low_ = 1600;
45  uint32_t bit_zero_low_ = 550;
46 
47  bool fahrenheit_{false};
48 
50 };
51 
52 } // namespace whynter
53 } // namespace esphome
This class is used to encode all control actions on a climate device.
Definition: climate.h:33
The fan mode is set to Low.
Definition: climate_mode.h:54
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
Definition: whynter.cpp:102
void transmit_(uint32_t value)
Definition: whynter.cpp:158
const uint8_t TEMP_MIN_C
Definition: whynter.h:11
const uint8_t TEMP_MAX_C
Definition: whynter.h:12
void set_fahrenheit(bool value)
Definition: whynter.h:26
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
Definition: climate_ir.cpp:61
climate::ClimateMode mode_before_
Definition: whynter.h:49
void transmit_state() override
Transmit via IR the state of this climate controller.
Definition: whynter.cpp:43
const uint8_t TEMP_MAX_F
Definition: whynter.h:14
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
Definition: whynter.h:23
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
const uint8_t TEMP_MIN_F
Definition: whynter.h:13
The fan mode is set to High.
Definition: climate_mode.h:58
ClimateMode
Enum for all modes a climate device can be in.
Definition: climate_mode.h:10
The climate device is off.
Definition: climate_mode.h:12
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
The fan mode is set to Medium.
Definition: climate_mode.h:56
constexpr float fahrenheit_to_celsius(float value)
Convert degrees Fahrenheit to degrees Celsius.
Definition: helpers.h:461