mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-25 07:08:30 +02:00
add support for climate action (#720)
* add support for climate action: Following hass implementation of climate, action represents the current action the climate device is perfoming, e.g. cooling or heating fix bang_bang climate: make sure that the thresholds are always respected. fixes the issue where the component would just keep on heating, regardless of the temperature range * Updates - Use dedicated enum for action (otherwise it gets confusing because "auto" is not a valid action) - Add field to tell HA that action is supported - Revert semantic changes in bang_bang * Conditional print Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
committed by
Otto Winter
parent
22aecdfc6f
commit
72d6471ab8
@@ -17,6 +17,18 @@ const char *climate_mode_to_string(ClimateMode mode) {
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
const char *climate_action_to_string(ClimateAction action) {
|
||||
switch (action) {
|
||||
case CLIMATE_ACTION_OFF:
|
||||
return "OFF";
|
||||
case CLIMATE_ACTION_COOLING:
|
||||
return "COOLING";
|
||||
case CLIMATE_ACTION_HEATING:
|
||||
return "HEATING";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace climate
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user