ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
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);
28 void set_supports_cool(bool supports_cool);
29 void set_supports_heat(bool supports_heat);
30 void set_normal_config(const BangBangClimateTargetTempConfig &normal_config);
31 void set_away_config(const BangBangClimateTargetTempConfig &away_config);
32
36
37 protected:
39 void control(const climate::ClimateCall &call) override;
41 void change_away_(bool away);
44
46 void compute_state_();
47
50
55
76
82 bool supports_cool_{false};
83 bool supports_heat_{false};
84
85 bool supports_away_{false};
86
89};
90
91} // namespace bang_bang
92} // 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/heating.
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:178
ClimateAction action
The active state of the climate device.
Definition climate.h:259
Base-class for all sensors.
Definition sensor.h:42
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