Skip to main content
Version: v3

STEP

Creating Sensors

const step = hmSensor.createSensor(hmSensor.id.STEP)

console.log(step.current)

STEP instance

step: object

PropertiesDescriptionType
currentcurrent step numbernumber
targettarget stepnumber

Registering sensor instance callback events

step.addEventListener(event, callback: Callback)

The events of CHANGE

The value of event

hmSensor.event.CHANGE

Callback

() => void

The example of events

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