7using namespace remote_base;
14static const PresetMapping PRESETS[] PROGMEM = {
24static const FanMapping FANS[] PROGMEM = {
32template<
typename T>
static T load_entry(
const T &slot) {
40 for (
const auto &slot : PRESETS) {
41 const auto entry = load_entry(slot);
42 if (entry.preset ==
preset)
45 return load_entry(PRESETS[0]).mode;
49 for (
const auto &slot : PRESETS) {
50 const auto entry = load_entry(slot);
51 if (entry.mode ==
mode)
54 return load_entry(PRESETS[0]).preset;
58 for (
const auto &slot : FANS) {
59 const auto entry = load_entry(slot);
63 return load_entry(FANS[0]).fan;
67 for (
const auto &slot : FANS) {
68 const auto entry = load_entry(slot);
70 return entry.fan_mode;
72 return load_entry(FANS[0]).fan_mode;
96 data.command = command;
107 this->preset = to_climate_preset(
mode);
110 this->
transmit_frame_(IRA211Command::IRA211_COMMAND_POWER, IRA211Mode::IRA211_MODE_PROTECTION, fan);
124 if (
mode == IRA211Mode::IRA211_MODE_PROTECTION) {
133 this->preset = to_climate_preset(
mode);
138 if (!decoded.has_value())
143 case IRA211Command::IRA211_COMMAND_SYNC:
144 case IRA211Command::IRA211_COMMAND_POWER:
147 this->fan_mode = to_climate_fan_mode(frame.
fan);
149 case IRA211Command::IRA211_COMMAND_TEMP_UP:
150 case IRA211Command::IRA211_COMMAND_TEMP_DOWN:
153 case IRA211Command::IRA211_COMMAND_MODE:
156 case IRA211Command::IRA211_COMMAND_FAN:
157 this->fan_mode = to_climate_fan_mode(frame.
fan);
BedjetMode mode
BedJet operating mode.
constexpr size_t count(ValueType value) const
Check if the set contains a specific value (std::set compatibility) Returns 1 if present,...
constexpr void erase(ValueType value)
Remove a value from the set (std::set compatibility)
ClimateMode mode
The active mode of the climate device.
float target_temperature
The target temperature of the climate device.
void publish_state()
Publish the state of the climate device, to be called from integrations.
climate::ClimateModeMask modes_
optional< IRA211Data > decode(RemoteReceiveData src)
void transmit_(const typename Protocol::ProtocolData &data, uint32_t send_times=1, uint32_t send_wait=0)
void transmit_state() override
bool on_receive(remote_base::RemoteReceiveData data) override
void transmit_frame_(remote_base::IRA211Command command, remote_base::IRA211Mode mode, remote_base::IRA211Fan fan)
void apply_mode_(remote_base::IRA211Mode mode)
climate::ClimateMode active_mode_() const
ClimatePreset
Enum for all preset modes NOTE: If adding values, update ClimatePresetMask in climate_traits....
@ CLIMATE_PRESET_COMFORT
Device is in comfort preset.
@ CLIMATE_PRESET_ECO
Device is running an energy-saving preset.
ClimateMode
Enum for all modes a climate device can be in.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
ClimateFanMode
NOTE: If adding values, update ClimateFanModeMask in climate_traits.h to use the new last value.
@ 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.
void progmem_memcpy(void *dst, const void *src, size_t len)
float get_temperature() const