 {
     acSwing = param.asInt();
     if (acState){
-        sendCodesTask();
+        sendCodesTask(acState);
     }
 }
 

    }
}

void sendCodesTask()
{
    struct airCon newAc;
    int *codes;

    codes = getCodes(&newAc,fanStrength,acMode,temperature,acState,acSwing);
    irRemoteSendRaw(codes,TIMINGS_LENGTH);
}


{
    fanStrength = param.asInt();
    if (acState){
        sendCodesTask(acState);
    }
}

