2019-04-17 12:06:00 +02:00
|
|
|
#include "climate_mode.h"
|
|
|
|
|
|
|
|
namespace esphome {
|
|
|
|
namespace climate {
|
|
|
|
|
2021-09-13 09:48:52 +02:00
|
|
|
const LogString *climate_mode_to_string(ClimateMode mode) {
|
2019-04-17 12:06:00 +02:00
|
|
|
switch (mode) {
|
|
|
|
case CLIMATE_MODE_OFF:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("OFF");
|
|
|
|
case CLIMATE_MODE_HEAT_COOL:
|
|
|
|
return LOG_STR("HEAT_COOL");
|
2019-04-17 12:06:00 +02:00
|
|
|
case CLIMATE_MODE_AUTO:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("AUTO");
|
2019-04-17 12:06:00 +02:00
|
|
|
case CLIMATE_MODE_COOL:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("COOL");
|
2019-04-17 12:06:00 +02:00
|
|
|
case CLIMATE_MODE_HEAT:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("HEAT");
|
2019-11-16 16:34:11 +01:00
|
|
|
case CLIMATE_MODE_FAN_ONLY:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("FAN_ONLY");
|
2019-11-16 16:34:11 +01:00
|
|
|
case CLIMATE_MODE_DRY:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("DRY");
|
2019-04-17 12:06:00 +02:00
|
|
|
default:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("UNKNOWN");
|
2019-04-17 12:06:00 +02:00
|
|
|
}
|
|
|
|
}
|
2021-09-13 09:48:52 +02:00
|
|
|
const LogString *climate_action_to_string(ClimateAction action) {
|
2019-10-18 10:39:14 +02:00
|
|
|
switch (action) {
|
|
|
|
case CLIMATE_ACTION_OFF:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("OFF");
|
2019-10-18 10:39:14 +02:00
|
|
|
case CLIMATE_ACTION_COOLING:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("COOLING");
|
2019-10-18 10:39:14 +02:00
|
|
|
case CLIMATE_ACTION_HEATING:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("HEATING");
|
2019-11-26 17:56:04 +01:00
|
|
|
case CLIMATE_ACTION_IDLE:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("IDLE");
|
2019-11-26 17:56:04 +01:00
|
|
|
case CLIMATE_ACTION_DRYING:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("DRYING");
|
2019-11-26 17:56:04 +01:00
|
|
|
case CLIMATE_ACTION_FAN:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("FAN");
|
2019-10-18 10:39:14 +02:00
|
|
|
default:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("UNKNOWN");
|
2019-10-18 10:39:14 +02:00
|
|
|
}
|
|
|
|
}
|
2019-04-17 12:06:00 +02:00
|
|
|
|
2021-09-13 09:48:52 +02:00
|
|
|
const LogString *climate_fan_mode_to_string(ClimateFanMode fan_mode) {
|
2019-11-16 16:34:11 +01:00
|
|
|
switch (fan_mode) {
|
|
|
|
case climate::CLIMATE_FAN_ON:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("ON");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_OFF:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("OFF");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_AUTO:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("AUTO");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_LOW:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("LOW");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_MEDIUM:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("MEDIUM");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_HIGH:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("HIGH");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_MIDDLE:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("MIDDLE");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_FOCUS:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("FOCUS");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_FAN_DIFFUSE:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("DIFFUSE");
|
2019-11-16 16:34:11 +01:00
|
|
|
default:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("UNKNOWN");
|
2019-11-16 16:34:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-13 09:48:52 +02:00
|
|
|
const LogString *climate_swing_mode_to_string(ClimateSwingMode swing_mode) {
|
2019-11-16 16:34:11 +01:00
|
|
|
switch (swing_mode) {
|
|
|
|
case climate::CLIMATE_SWING_OFF:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("OFF");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_SWING_BOTH:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("BOTH");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_SWING_VERTICAL:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("VERTICAL");
|
2019-11-16 16:34:11 +01:00
|
|
|
case climate::CLIMATE_SWING_HORIZONTAL:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("HORIZONTAL");
|
2019-11-16 16:34:11 +01:00
|
|
|
default:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("UNKNOWN");
|
2019-11-16 16:34:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-13 09:48:52 +02:00
|
|
|
const LogString *climate_preset_to_string(ClimatePreset preset) {
|
2021-06-04 12:04:54 +02:00
|
|
|
switch (preset) {
|
2021-06-23 20:25:19 +02:00
|
|
|
case climate::CLIMATE_PRESET_NONE:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("NONE");
|
2021-06-21 21:17:01 +02:00
|
|
|
case climate::CLIMATE_PRESET_HOME:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("HOME");
|
2021-06-04 12:04:54 +02:00
|
|
|
case climate::CLIMATE_PRESET_ECO:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("ECO");
|
2021-06-04 12:04:54 +02:00
|
|
|
case climate::CLIMATE_PRESET_AWAY:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("AWAY");
|
2021-06-04 12:04:54 +02:00
|
|
|
case climate::CLIMATE_PRESET_BOOST:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("BOOST");
|
2021-06-04 12:04:54 +02:00
|
|
|
case climate::CLIMATE_PRESET_COMFORT:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("COMFORT");
|
2021-06-04 12:04:54 +02:00
|
|
|
case climate::CLIMATE_PRESET_SLEEP:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("SLEEP");
|
2021-06-04 12:04:54 +02:00
|
|
|
case climate::CLIMATE_PRESET_ACTIVITY:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("ACTIVITY");
|
2021-06-04 12:04:54 +02:00
|
|
|
default:
|
2021-09-13 09:48:52 +02:00
|
|
|
return LOG_STR("UNKNOWN");
|
2021-06-04 12:04:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-17 12:06:00 +02:00
|
|
|
} // namespace climate
|
|
|
|
} // namespace esphome
|