ESPHome  2021.11.3
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");
65  default:
66  return LOG_STR("UNKNOWN");
67  }
68 }
69 
71  switch (swing_mode) {
73  return LOG_STR("OFF");
75  return LOG_STR("BOTH");
77  return LOG_STR("VERTICAL");
79  return LOG_STR("HORIZONTAL");
80  default:
81  return LOG_STR("UNKNOWN");
82  }
83 }
84 
86  switch (preset) {
88  return LOG_STR("NONE");
90  return LOG_STR("HOME");
92  return LOG_STR("ECO");
94  return LOG_STR("AWAY");
96  return LOG_STR("BOOST");
98  return LOG_STR("COMFORT");
100  return LOG_STR("SLEEP");
102  return LOG_STR("ACTIVITY");
103  default:
104  return LOG_STR("UNKNOWN");
105  }
106 }
107 
108 } // namespace climate
109 } // 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 Both.
Definition: climate_mode.h:72
ClimatePreset
Enum for all modes a climate swing can be in.
Definition: climate_mode.h:80
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:84
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:545
ClimateSwingMode
Enum for all modes a climate swing can be in.
Definition: climate_mode.h:68
Device is prepared for sleep.
Definition: climate_mode.h:94
Device is in away preset.
Definition: climate_mode.h:86
Device is in comfort preset.
Definition: climate_mode.h:90
The fan mode is set to Horizontal.
Definition: climate_mode.h:76
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:96
The fan mode is set to Auto.
Definition: climate_mode.h:52
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 ClimateSwingMode 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:74
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:70
The climate device is off.
Definition: climate_mode.h:12
ClimateFanMode fan_mode
Definition: climate.h:537
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:88
The fan mode is set to On.
Definition: climate_mode.h:48
ClimateMode mode
Definition: climate.h:534
Library based on https://github.com/miguelbalboa/rfid and adapted to ESPHome by . ...
Definition: a4988.cpp:4
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:92
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:542
const LogString * climate_swing_mode_to_string(ClimateSwingMode swing_mode)
Convert the given ClimateSwingMode to a human-readable string.