ESPHome 2026.5.0-dev
Loading...
Searching...
No Matches
bedjet_climate.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
10
11#ifdef USE_ESP32
12
13namespace esphome {
14namespace bedjet {
15
17 public:
18 void setup() override;
19 void loop() override;
20 void update() override;
21 void dump_config() override;
22 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
23
24 /* BedJetClient status update */
25 void on_status(const BedjetStatusPacket *data) override;
26 void on_bedjet_state(bool is_ready) override;
27 std::string describe() override;
28
33
40 // climate::CLIMATE_MODE_TURBO // Not supported by Climate: see presets instead
43 });
44
46 // If we support NONE, then have to decide what happens if the user switches to it (turn off?)
47 // climate::CLIMATE_PRESET_NONE,
48 // Climate doesn't have a "TURBO" mode, but we can use the BOOST preset instead.
50 });
51 // Custom fan modes and presets are set once in setup(), stored on Climate base class,
52 // and wired automatically via get_traits()
56 return traits;
57 }
58
59 protected:
60 void control(const climate::ClimateCall &call) override;
61
64
65 void reset_state_();
66 bool update_status_();
67
68 bool is_valid_() {
69 // FIXME: find a better way to check this?
70 return !std::isnan(this->current_temperature) && !std::isnan(this->target_temperature) &&
71 this->current_temperature > 1 && this->target_temperature > 1;
72 }
73};
74
75} // namespace bedjet
76} // namespace esphome
77
78#endif
media_source::MediaSource * source
bool is_ready() const
This class simplifies creating components that periodically check a state.
Definition component.h:602
bool update_status_()
Attempts to update the climate device from the last received BedjetStatusPacket.
BedjetTemperatureSource temperature_source_
climate::ClimateTraits traits() override
void on_bedjet_state(bool is_ready) override
void reset_state_()
Resets states to defaults.
void set_temperature_source(BedjetTemperatureSource source)
Sets the temperature source to use for the climate entity's current temperature.
void control(const climate::ClimateCall &call) override
void set_heating_mode(BedjetHeatMode mode)
Sets the default strategy to use for climate::CLIMATE_MODE_HEAT.
float get_setup_priority() const override
std::string describe() override
void on_status(const BedjetStatusPacket *data) override
This class is used to encode all control actions on a climate device.
Definition climate.h:34
ClimateDevice - This is the base class for all climate integrations.
Definition climate.h:187
ClimateMode mode
The active mode of the climate device.
Definition climate.h:293
float target_temperature
The target temperature of the climate device.
Definition climate.h:274
float current_temperature
The current temperature of the climate device, as reported from the integration.
Definition climate.h:267
void set_visual_max_temperature(float visual_max_temperature)
void add_feature_flags(uint32_t feature_flags)
void set_visual_temperature_step(float temperature_step)
void set_supported_presets(ClimatePresetMask presets)
void set_visual_min_temperature(float visual_min_temperature)
void set_supported_modes(ClimateModeMask modes)
BedjetHeatMode
Optional heating strategies to use for climate::CLIMATE_MODE_HEAT.
@ HEAT_MODE_HEAT
HVACMode.HEAT is handled using BTN_HEAT (default)
@ CLIMATE_SUPPORTS_CURRENT_TEMPERATURE
@ CLIMATE_PRESET_BOOST
Device is in boost preset.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
constexpr float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition component.h:52
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
The format of a BedJet V3 status packet.