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:
Guillermo Ruffino
2019-11-16 12:34:11 -03:00
committed by Otto Winter
parent 4f8f59f705
commit 1814e4a46b
21 changed files with 824 additions and 85 deletions
+16 -1
View File
@@ -11,13 +11,28 @@ const uint8_t COOLIX_TEMP_MAX = 30; // Celsius
class CoolixClimate : public climate_ir::ClimateIR {
public:
CoolixClimate() : climate_ir::ClimateIR(COOLIX_TEMP_MIN, COOLIX_TEMP_MAX) {}
CoolixClimate()
: climate_ir::ClimateIR(COOLIX_TEMP_MIN, COOLIX_TEMP_MAX, 1.0f, true, true,
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM,
climate::CLIMATE_FAN_HIGH},
{climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_VERTICAL}) {}
/// Override control to change settings of the climate device.
void control(const climate::ClimateCall &call) override {
send_swing_cmd_ = call.get_swing_mode().has_value();
// swing resets after unit powered off
if (call.get_mode().has_value() && *call.get_mode() == climate::CLIMATE_MODE_OFF)
this->swing_mode = climate::CLIMATE_SWING_OFF;
climate_ir::ClimateIR::control(call);
}
protected:
/// Transmit via IR the state of this climate controller.
void transmit_state() override;
/// Handle received IR Buffer
bool on_receive(remote_base::RemoteReceiveData data) override;
bool send_swing_cmd_{false};
};
} // namespace coolix