ESPHome 2025.5.0
Loading...
Searching...
No Matches
toshiba.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome {
6namespace toshiba {
7
8// Simple enum to represent models.
9enum Model {
10 MODEL_GENERIC = 0, // Temperature range is from 17 to 30
11 MODEL_RAC_PT1411HWRU_C = 1, // Temperature range is from 16 to 30
12 MODEL_RAC_PT1411HWRU_F = 2, // Temperature range is from 16 to 30
13};
14
15// Supported temperature ranges
16const float TOSHIBA_GENERIC_TEMP_C_MIN = 17.0;
17const float TOSHIBA_GENERIC_TEMP_C_MAX = 30.0;
22
24 public:
29
30 void setup() override;
31 void set_model(Model model) { this->model_ = model; }
32
33 protected:
34 void transmit_state() override;
35 void transmit_generic_();
37 void transmit_rac_pt1411hwru_temp_(bool cs_state = true, bool cs_send_update = true);
38 // Returns the header if valid, else returns zero
39 uint8_t is_valid_rac_pt1411hwru_header_(const uint8_t *message);
40 // Returns true if message is a valid RAC-PT1411HWRU IR message, regardless if first or second packet
41 bool is_valid_rac_pt1411hwru_message_(const uint8_t *message);
42 // Returns true if message1 and message 2 are the same
43 bool compare_rac_pt1411hwru_packets_(const uint8_t *message1, const uint8_t *message2);
45
52 std::set<climate::ClimateSwingMode> toshiba_swing_modes_() {
53 return (this->model_ == MODEL_GENERIC)
54 ? std::set<climate::ClimateSwingMode>{}
55 : std::set<climate::ClimateSwingMode>{climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_VERTICAL};
56 }
57 void encode_(remote_base::RemoteTransmitData *data, const uint8_t *message, uint8_t nbytes, uint8_t repeat);
58 bool decode_(remote_base::RemoteReceiveData *data, uint8_t *message, uint8_t nbytes);
59
61};
62
63} // namespace toshiba
64} // namespace esphome
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
void encode_(remote_base::RemoteTransmitData *data, const uint8_t *message, uint8_t nbytes, uint8_t repeat)
Definition toshiba.cpp:732
bool compare_rac_pt1411hwru_packets_(const uint8_t *message1, const uint8_t *message2)
Definition toshiba.cpp:456
bool is_valid_rac_pt1411hwru_message_(const uint8_t *message)
Definition toshiba.cpp:464
uint8_t is_valid_rac_pt1411hwru_header_(const uint8_t *message)
Definition toshiba.cpp:442
void set_model(Model model)
Definition toshiba.h:31
bool decode_(remote_base::RemoteReceiveData *data, uint8_t *message, uint8_t nbytes)
Definition toshiba.cpp:753
std::set< climate::ClimateSwingMode > toshiba_swing_modes_()
Definition toshiba.h:52
void transmit_rac_pt1411hwru_temp_(bool cs_state=true, bool cs_send_update=true)
Definition toshiba.cpp:385
bool on_receive(remote_base::RemoteReceiveData data) override
Definition toshiba.cpp:493
@ 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_QUIET
The fan mode is set to Quiet.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
@ MODEL_RAC_PT1411HWRU_C
Definition toshiba.h:11
@ MODEL_RAC_PT1411HWRU_F
Definition toshiba.h:12
const float TOSHIBA_RAC_PT1411HWRU_TEMP_F_MIN
Definition toshiba.h:20
const float TOSHIBA_GENERIC_TEMP_C_MAX
Definition toshiba.h:17
const float TOSHIBA_GENERIC_TEMP_C_MIN
Definition toshiba.h:16
const float TOSHIBA_RAC_PT1411HWRU_TEMP_C_MAX
Definition toshiba.h:19
const float TOSHIBA_RAC_PT1411HWRU_TEMP_C_MIN
Definition toshiba.h:18
const float TOSHIBA_RAC_PT1411HWRU_TEMP_F_MAX
Definition toshiba.h:21
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7