Ambient Light State

The current ambient light state.

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);
pageAmbientLightState

Last updated