From 5a12bd2d0ef2d3fb474bfaf1dbae1b965e7250be Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 13 Apr 2020 10:16:02 +0300 Subject: [PATCH] #101 Ballu should implement the HeatpumpIR interface --- BalluHeatpumpIR.cpp | 13 ++++++------- BalluHeatpumpIR.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/BalluHeatpumpIR.cpp b/BalluHeatpumpIR.cpp index f7c5427..49288ab 100644 --- a/BalluHeatpumpIR.cpp +++ b/BalluHeatpumpIR.cpp @@ -10,16 +10,16 @@ BalluHeatpumpIR::BalluHeatpumpIR() } -void BalluHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd) +void BalluHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd) { // Sensible defaults for the heat pump mode - + uint8_t operatingMode = BALLU_AIRCON_MODE_COOL; uint8_t fanSpeed = BALLU_AIRCON_FAN_AUTO; uint8_t temperature = 21; uint8_t powerMode = 00; - - + + if (powerModeCmd == POWER_OFF) { powerMode = BALLU_AIRCON_MODE_OFF; @@ -43,7 +43,7 @@ void BalluHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operating break; } } - + switch (fanSpeedCmd) { case FAN_AUTO: @@ -59,12 +59,11 @@ void BalluHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operating fanSpeed = BALLU_AIRCON_FAN3; break; } - + if (temperatureCmd > 15 && temperatureCmd < 31) { temperature = temperatureCmd; } - sendBallu(IR, powerMode, operatingMode, fanSpeed, temperature); } diff --git a/BalluHeatpumpIR.h b/BalluHeatpumpIR.h index 2d65960..2982820 100644 --- a/BalluHeatpumpIR.h +++ b/BalluHeatpumpIR.h @@ -35,7 +35,7 @@ class BalluHeatpumpIR : public HeatpumpIR { public: BalluHeatpumpIR(); - void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd); + void send(IRSender& IR, uint8_t powerModeCmd, uint8_t operatingModeCmd, uint8_t fanSpeedCmd, uint8_t temperatureCmd, uint8_t swingVCmd, uint8_t swingHCmd); private: void sendBallu(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature);