Skip to main content
Version: v3+

WEAR

Creating Sensors​

const wear = hmSensor.createSensor(hmSensor.id.WEAR)

console.log(wear.current)

WEAR instance​

wear: object​

PropertiesDescriptionType
currentCurrent wear status, see table belownumber
Current valueDescription
0Not worn
1Wearing
2In motion
3Not sure

Registering sensor instance callback events.​

wear.addEventListener(event, callback: Callback)

The events of CHANGE​

The value of event​

hmSensor.event.CHANGE

Callback​

() => void

The example of events​

wear.addEventListener(hmSensor.event.CHANGE, function () {
console.log('The current wear statusis ' + wear.current + '\r\n')
})