Based on the value measured by the hubs ambient light sensor, one of the categories is reported.
const onAmbientLightStateChange = (value: AmbientLightState, timestamp?: Date) => {
console.log(value, timestamp);
};
COBI.hub.ambientLightState.read(onAmbientLightStateChange); // Instantly get the current value
COBI.hub.ambientLightState.subscribe(onAmbientLightStateChange);
COBI.hub.ambientLightState.unsubscribe(onAmbientLightStateChange);
const onAmbientLightStateChange = (value, timestamp) => {
console.log(value, timestamp);
};
COBI.hub.ambientLightState.read(onAmbientLightStateChange); // Instantly get the current value
COBI.hub.ambientLightState.subscribe(onAmbientLightStateChange);
COBI.hub.ambientLightState.unsubscribe(onAmbientLightStateChange);