open-zigbee / zigbee-bridge

An open source ZigBee gateway solution with node.js.
https://open-zigbee.github.io/zigbee-bridge
27 stars 4 forks source link

Allow to specify cluster attributes as an object (proprietary attributes) #9

Closed itsmepetrov closed 6 years ago

itsmepetrov commented 6 years ago

This PR brings an ability to specify cluster attributes as an object for the following Bridge methods:

Example:

// attribute id
ep1.report('msTemperatureMeasurement', 'measuredValue', 3, 5, 100, (err) => {
  if (!err) {
    console.log('Successfully configure ep1 report temperature attribute!');
  }
});

// attribute definition (example for Xiaomi devices proprietary attribute)
ep1.report('genBasic', { id: 65281, type: 'charStr' }, 1, 60, 100, (err) => {
  if (!err) {
    console.log('Successfully configure ep1 report proprietary attribute!');
  }
});

It allows us to use proprietary attributes without updating zigbee-bridge-definitions module.

Other changes in this PR: