Implemented methods responding to changes in state for the master switch and child switches.