1.2.5 • Published 4 years ago

@haum/device v1.2.5

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Haum Device

Example

const device = require('@haum/device')

// Create a new device
const myDevice = device('myDevice')

// Let others discover the device
myDevice.discovery({
  items: {
    myItem: {
      type: 'string'
    }
  }
})

// Listen for change requests and emit new state
myDevice.item('myItem').on('change', value => {
  console.log('CHANGE:', value)
  myDevice.item('myItem').emit('state', msg)
})

// Does the same as above
myDevice.on('myItem', 'change', value => {
  console.log('CHANGE:', value)
  myDevice.emit('myItem', 'state', msg)
})
1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago