Manual activation of a switch should override the automation

Please format your code