mirror of
https://github.com/esphome/esphome.git
synced 2025-11-17 07:15:48 +00:00
Add climate dry fan (#845)
* add climate dry fan * clang-format * updates, add swing mode, add back compat with old ha * revert client-config add swing * sort const.py * fix missing retur
This commit is contained in:
committed by
Otto Winter
parent
4f8f59f705
commit
1814e4a46b
@@ -30,6 +30,10 @@ void MQTTClimateComponent::send_discovery(JsonObject &root, mqtt::SendDiscoveryC
|
||||
modes.add("cool");
|
||||
if (traits.supports_mode(CLIMATE_MODE_HEAT))
|
||||
modes.add("heat");
|
||||
if (traits.supports_mode(CLIMATE_MODE_FAN_ONLY))
|
||||
modes.add("fan_only");
|
||||
if (traits.supports_mode(CLIMATE_MODE_DRY))
|
||||
modes.add("dry");
|
||||
|
||||
if (traits.get_supports_two_point_target_temperature()) {
|
||||
// temperature_low_command_topic
|
||||
@@ -155,6 +159,12 @@ bool MQTTClimateComponent::publish_state_() {
|
||||
case CLIMATE_MODE_HEAT:
|
||||
mode_s = "heat";
|
||||
break;
|
||||
case CLIMATE_MODE_FAN_ONLY:
|
||||
mode_s = "fan_only";
|
||||
break;
|
||||
case CLIMATE_MODE_DRY:
|
||||
mode_s = "dry";
|
||||
break;
|
||||
}
|
||||
bool success = true;
|
||||
if (!this->publish(this->get_mode_state_topic(), mode_s))
|
||||
|
||||
Reference in New Issue
Block a user