Issues with connecting a slideswitch to change between automatic and manual mode for a fan

Maybe I have missed it, but you do not appear to read the switch.
I'd have expected a digitalRead( 6 ) somewhere.