added getLightState function