Logic for calling functions

Hello,
I m using mode mcu for my project...aim of my project is to control home appliances manually as well as automatically.. so for this purpose I have return 3 methods one method is call commands from cloud based on the commands from the cloud other two functions are to be performed . If I get automatic as the command then home appliances control Inc should be done automatically. If the command is manual then I use an app to control
Please tel me some logic to do this

Please tel me some logic to do this

if(mode == MANUAL)
{
   // Do the manual stuff
}
else if (mode == AUTOMATIC)
{
   // Do whatever with no user input
}

Its up to you to define MANUAL, AUTOMATIC, and mode, and assign mode the appropriate value.

When in either mode, you want to be sure to check for the user's desire to change modes.