ESPHome  2024.11.0
noblex.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace esphome {
6 namespace noblex {
7 
8 // Temperature
9 const uint8_t NOBLEX_TEMP_MIN = 16; // Celsius
10 const uint8_t NOBLEX_TEMP_MAX = 30; // Celsius
11 
13  public:
15  : climate_ir::ClimateIR(NOBLEX_TEMP_MIN, NOBLEX_TEMP_MAX, 1.0f, true, true,
19 
20  void setup() override {
23  }
24 
25  // Override control to change settings of the climate device.
26  void control(const climate::ClimateCall &call) override {
28  // swing resets after unit powered off
29  if (call.get_mode().has_value() && *call.get_mode() == climate::CLIMATE_MODE_OFF)
32  }
33 
34  // used to track when to send the power toggle command.
36 
37  protected:
39  void transmit_state() override;
41  bool on_receive(remote_base::RemoteReceiveData data) override;
42  bool send_swing_cmd_{false};
43  bool receiving_ = false;
44 };
45 
46 } // namespace noblex
47 } // 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
ClimateSwingMode swing_mode
The active swing mode of the climate device.
Definition: climate.h:202
const optional< ClimateMode > & get_mode() const
Definition: climate.cpp:273
const uint8_t NOBLEX_TEMP_MAX
Definition: noblex.h:10
ClimateMode mode
The active mode of the climate device.
Definition: climate.h:173
bool has_value() const
Definition: optional.h:87
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
Definition: climate_ir.cpp:61
const uint8_t NOBLEX_TEMP_MIN
Definition: noblex.h:9
The fan mode is set to Auto.
Definition: climate_mode.h:52
void transmit_state() override
Transmit via IR the state of this climate controller.
Definition: noblex.cpp:34
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
The fan mode is set to High.
Definition: climate_mode.h:58
The swing mode is set to Off.
Definition: climate_mode.h:72
The climate device is off.
Definition: climate_mode.h:12
const optional< ClimateSwingMode > & get_swing_mode() const
Definition: climate.cpp:282
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
Definition: noblex.cpp:147
The fan mode is set to Medium.
Definition: climate_mode.h:56
void control(const climate::ClimateCall &call) override
Definition: noblex.h:26
void setup() override
Definition: noblex.h:20