#101 Ballu should implement the HeatpumpIR interface

This commit is contained in:
Toni 2020-04-13 10:16:02 +03:00
parent 304db4f7d6
commit 5a12bd2d0e
2 changed files with 7 additions and 8 deletions

View File

@ -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 // Sensible defaults for the heat pump mode
uint8_t operatingMode = BALLU_AIRCON_MODE_COOL; uint8_t operatingMode = BALLU_AIRCON_MODE_COOL;
uint8_t fanSpeed = BALLU_AIRCON_FAN_AUTO; uint8_t fanSpeed = BALLU_AIRCON_FAN_AUTO;
uint8_t temperature = 21; uint8_t temperature = 21;
uint8_t powerMode = 00; uint8_t powerMode = 00;
if (powerModeCmd == POWER_OFF) if (powerModeCmd == POWER_OFF)
{ {
powerMode = BALLU_AIRCON_MODE_OFF; powerMode = BALLU_AIRCON_MODE_OFF;
@ -43,7 +43,7 @@ void BalluHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operating
break; break;
} }
} }
switch (fanSpeedCmd) switch (fanSpeedCmd)
{ {
case FAN_AUTO: case FAN_AUTO:
@ -59,12 +59,11 @@ void BalluHeatpumpIR::send(IRSender& IR, uint8_t powerModeCmd, uint8_t operating
fanSpeed = BALLU_AIRCON_FAN3; fanSpeed = BALLU_AIRCON_FAN3;
break; break;
} }
if (temperatureCmd > 15 && temperatureCmd < 31) if (temperatureCmd > 15 && temperatureCmd < 31)
{ {
temperature = temperatureCmd; temperature = temperatureCmd;
} }
sendBallu(IR, powerMode, operatingMode, fanSpeed, temperature); sendBallu(IR, powerMode, operatingMode, fanSpeed, temperature);
} }

View File

@ -35,7 +35,7 @@ class BalluHeatpumpIR : public HeatpumpIR
{ {
public: public:
BalluHeatpumpIR(); 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: private:
void sendBallu(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature); void sendBallu(IRSender& IR, uint8_t powerMode, uint8_t operatingMode, uint8_t fanSpeed, uint8_t temperature);