ESPHome 2025.5.2
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
bang_bang_climate.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace esphome {
9namespace bang_bang {
10
19
21 public:
23 void setup() override;
24 void dump_config() override;
25
26 void set_sensor(sensor::Sensor *sensor);
27 void set_humidity_sensor(sensor::Sensor *humidity_sensor);
30 void set_supports_cool(bool supports_cool);
32 void set_supports_heat(bool supports_heat);
33 void set_normal_config(const BangBangClimateTargetTempConfig &normal_config);
34 void set_away_config(const BangBangClimateTargetTempConfig &away_config);
35
36 protected:
38 void control(const climate::ClimateCall &call) override;
40 void change_away_(bool away);
43
45 void compute_state_();
46
49
54
68 bool supports_cool_{false};
76 bool supports_heat_{false};
82
84 bool supports_away_{false};
86};
87
88} // namespace bang_bang
89} // namespace esphome
void compute_state_()
Re-compute the state of this climate controller.
BangBangClimateTargetTempConfig away_config_
void set_away_config(const BangBangClimateTargetTempConfig &away_config)
bool supports_cool_
Whether the controller supports cooling.
void set_supports_heat(bool supports_heat)
climate::ClimateTraits traits() override
Return the traits of this controller.
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
void set_sensor(sensor::Sensor *sensor)
void set_supports_cool(bool supports_cool)
void change_away_(bool away)
Change the away setting, will reset target temperatures to defaults.
Trigger * idle_trigger_
The trigger to call when the controller should switch to idle mode.
void set_normal_config(const BangBangClimateTargetTempConfig &normal_config)
Trigger * prev_trigger_
A reference to the trigger that was previously active.
sensor::Sensor * sensor_
The sensor used for getting the current temperature.
Trigger * cool_trigger_
The trigger to call when the controller should switch to cooling mode.
void switch_to_action_(climate::ClimateAction action)
Switch the climate device to the given climate mode.
Trigger * heat_trigger_
The trigger to call when the controller should switch to heating mode.
BangBangClimateTargetTempConfig normal_config_
sensor::Sensor * humidity_sensor_
The sensor used for getting the current humidity.
void set_humidity_sensor(sensor::Sensor *humidity_sensor)
This class is used to encode all control actions on a climate device.
Definition climate.h:33
ClimateDevice - This is the base class for all climate integrations.
Definition climate.h:168
ClimateAction action
The active state of the climate device.
Definition climate.h:176
This class contains all static data for climate devices.
Base-class for all sensors.
Definition sensor.h:57
ClimateAction
Enum for the current action of the climate device. Values match those of ClimateMode.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7