ESPHome  2024.10.2
climate_mode.cpp
Go to the documentation of this file.
1 #include "climate_mode.h"
2 
3 namespace esphome {
4 namespace climate {
5 
7  switch (mode) {
8  case CLIMATE_MODE_OFF:
9  return LOG_STR("OFF");
11  return LOG_STR("HEAT_COOL");
12  case CLIMATE_MODE_AUTO:
13  return LOG_STR("AUTO");
14  case CLIMATE_MODE_COOL:
15  return LOG_STR("COOL");
16  case CLIMATE_MODE_HEAT:
17  return LOG_STR("HEAT");
19  return LOG_STR("FAN_ONLY");
20  case CLIMATE_MODE_DRY:
21  return LOG_STR("DRY");
22  default:
23  return LOG_STR("UNKNOWN");
24  }
25 }
26 const LogString *climate_action_to_string(ClimateAction action) {
27  switch (action) {
28  case CLIMATE_ACTION_OFF:
29  return LOG_STR("OFF");
31  return LOG_STR("COOLING");
33  return LOG_STR("HEATING");
35  return LOG_STR("IDLE");
37  return LOG_STR("DRYING");
38  case CLIMATE_ACTION_FAN:
39  return LOG_STR("FAN");
40  default:
41  return LOG_STR("UNKNOWN");
42  }
43 }
44 
46  switch (fan_mode) {
48  return LOG_STR("ON");
50  return LOG_STR("OFF");
52  return LOG_STR("AUTO");
54  return LOG_STR("LOW");
56  return LOG_STR("MEDIUM");
58  return LOG_STR("HIGH");
60  return LOG_STR("MIDDLE");
62  return LOG_STR("FOCUS");
64  return LOG_STR("DIFFUSE");
66  return LOG_STR("QUIET");
67  default:
68  return LOG_STR("UNKNOWN");
69  }
70 }
71 
73  switch (swing_mode) {
75  return LOG_STR("OFF");
77  return LOG_STR("BOTH");
79  return LOG_STR("VERTICAL");
81  return LOG_STR("HORIZONTAL");
82  default:
83  return LOG_STR("UNKNOWN");
84  }
85 }
86 
88  switch (preset) {
90  return LOG_STR("NONE");
92  return LOG_STR("HOME");
94  return LOG_STR("ECO");
96  return LOG_STR("AWAY");
98  return LOG_STR("BOOST");
100  return LOG_STR("COMFORT");
102  return LOG_STR("SLEEP");
104  return LOG_STR("ACTIVITY");
105  default:
106  return LOG_STR("UNKNOWN");
107  }
108 }
109 
110 } // namespace climate
111 } // namespace esphome
The fan mode is set to Low.
Definition: climate_mode.h:54
The climate device is off (inactive or no power)
Definition: climate_mode.h:33
The fan mode is set to Quiet.
Definition: climate_mode.h:66
The fan mode is set to Both.
Definition: climate_mode.h:74
ClimatePreset
Enum for all preset modes.
Definition: climate_mode.h:82
The climate device is drying.
Definition: climate_mode.h:41
The climate device is in fan only mode.
Definition: climate_mode.h:43
Device is in home preset.
Definition: climate_mode.h:86
The fan mode is set to Middle.
Definition: climate_mode.h:60
const LogString * climate_mode_to_string(ClimateMode mode)
Convert the given ClimateMode to a human-readable string.
Definition: climate_mode.cpp:6
The climate device is set to heat to reach the target temperature.
Definition: climate_mode.h:18
The fan mode is set to Diffuse.
Definition: climate_mode.h:64
The climate device is set to dry/humidity mode.
Definition: climate_mode.h:22
ClimateSwingMode swing_mode
Definition: climate.h:581
ClimateSwingMode
Enum for all modes a climate swing can be in.
Definition: climate_mode.h:70
Device is prepared for sleep.
Definition: climate_mode.h:96
Device is in away preset.
Definition: climate_mode.h:88
Device is in comfort preset.
Definition: climate_mode.h:92
The fan mode is set to Horizontal.
Definition: climate_mode.h:78
The climate device is set to cool to reach the target temperature.
Definition: climate_mode.h:16
Device is reacting to activity (e.g., movement sensors)
Definition: climate_mode.h:98
The fan mode is set to Auto.
Definition: climate_mode.h:52
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:183
ClimateAction
Enum for the current action of the climate device. Values match those of ClimateMode.
Definition: climate_mode.h:31
const LogString * climate_preset_to_string(ClimatePreset preset)
Convert the given PresetMode to a human-readable string.
The climate device is adjusting the temperatre dynamically.
Definition: climate_mode.h:27
The climate device is set to heat/cool to reach the target temperature.
Definition: climate_mode.h:14
The fan mode is set to Vertical.
Definition: climate_mode.h:76
The climate device is actively heating.
Definition: climate_mode.h:37
The fan mode is set to Focus.
Definition: climate_mode.h:62
The fan mode is set to Off.
Definition: climate_mode.h:50
The fan mode is set to High.
Definition: climate_mode.h:58
ClimateMode
Enum for all modes a climate device can be in.
Definition: climate_mode.h:10
The swing mode is set to Off.
Definition: climate_mode.h:72
The climate device is off.
Definition: climate_mode.h:12
ClimateFanMode fan_mode
Definition: climate.h:573
const LogString * climate_fan_mode_to_string(ClimateFanMode fan_mode)
Convert the given ClimateFanMode to a human-readable string.
Device is in boost preset.
Definition: climate_mode.h:90
The fan mode is set to On.
Definition: climate_mode.h:48
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
The climate device is idle (monitoring climate but no action needed)
Definition: climate_mode.h:39
Device is running an energy-saving preset.
Definition: climate_mode.h:94
The fan mode is set to Medium.
Definition: climate_mode.h:56
The climate device only has the fan enabled, no heating or cooling is taking place.
Definition: climate_mode.h:20
const LogString * climate_action_to_string(ClimateAction action)
Convert the given ClimateAction to a human-readable string.
The climate device is actively cooling.
Definition: climate_mode.h:35
ClimatePreset preset
Definition: climate.h:578
const LogString * climate_swing_mode_to_string(ClimateSwingMode swing_mode)
Convert the given ClimateSwingMode to a human-readable string.