     Blynk.setProperty(V4,"color",color); // MODE
 
     if (acState){
-        sendCodesTask();
+        sendCodesTask(acState);
     }
 }
 

    temperature = param.asInt();
    Blynk.virtualWrite(V7,temperature);
    if (acState){
        sendCodesTask();
    }
}


    }
}

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

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

