Skip to main content
版本:v2

STAND

创建传感器​

const stand = hmSensor.createSensor(hmSensor.id.STAND)

console.log(stand.current)

stand 实例​

stand: object​

属性说明类型
current当前有站立小时number
target有站立小时目标number

注册传感器实例回调事件​

calorie.addEventListener(event, callback: Callback)

CHANGE 事件​

event 值​

hmSensor.event.CHANGE

Callback​

() => void

事件示例​

stand.addEventListener(hmSensor.event.CHANGE, function () {
console.log('the current stand: ' + stand.current + ' target: ' + stand.target + '\r\n')
})