Calculates dusk and switches on the light until sleep time. If it is still dark at wake time it switched on the light again till dawn.