smart-bus 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## 0.9.0
2
+
3
+ * Add Get Curtain Duration commands (`0xE800`, `0xE801`)
4
+ * Add Dry Contact Multi-Channel Status command (`0x6F00`)
5
+ * Add Dry Contact broadcast status commands (`0x15D0`, `0x15D1`)
6
+ * Fix `0xE3E3` Curtain Status to support optional duration field
7
+ * Add comprehensive test coverage for new commands
8
+ * Maintain 100% backward compatibility with existing implementations
9
+
10
+ ## 0.8.0
11
+
12
+ * Update for Node.js v22 compatibility
13
+ * Replace deprecated `new Buffer()` constructors with modern APIs
14
+ * Update minimum Node.js version from >=0.12 to >=12.0.0
15
+ * Update development dependencies (mocha, eslint, should, simple-mock)
16
+ * Replace istanbul with nyc for test coverage
17
+
18
+ **BREAKING:**
19
+
20
+ - Node.js version requirement increased from >=0.12 to >=12.0.0
21
+
1
22
  ## 0.7.0
2
23
 
3
24
  * Add Read Dry Contact Status commaands (`0x15CE`, `0x15CF`)
package/README.md CHANGED
@@ -242,7 +242,7 @@ bus.send({
242
242
  target: dimmer,
243
243
 
244
244
  command: 0x0031,
245
- payload: new Buffer('04640190', 'hex')
245
+ payload: Buffer.from('04640190', 'hex')
246
246
  }, function(err) { /* ... */ });
247
247
  ```
248
248
 
package/lib/bus.js CHANGED
@@ -9,16 +9,16 @@ var EventEmitter = require('events');
9
9
 
10
10
  module.exports = Bus;
11
11
 
12
- var Constants = new Buffer(12);
12
+ var Constants = Buffer.allocUnsafe(12);
13
13
 
14
- Constants.write('HDLMIRACLE');
14
+ Constants.write('HDLMIRACLE', 0, 'ascii');
15
15
  Constants.writeUInt16BE(0xAAAA, 10);
16
16
 
17
17
  function Bus(resource) {
18
18
  var config = parse(resource);
19
19
  var port = config.port;
20
20
 
21
- this.address = new Buffer([0, 0, 0, 0]);
21
+ this.address = Buffer.from([0, 0, 0, 0]);
22
22
 
23
23
  this.port = port ? parseInt(port) : 6000;
24
24
  this.gateway = config.gateway;
@@ -113,7 +113,7 @@ Bus.prototype.send = function(options, callback) {
113
113
  return callback(err);
114
114
  }
115
115
 
116
- var checksum = new Buffer(2);
116
+ var checksum = Buffer.allocUnsafe(2);
117
117
 
118
118
  checksum.writeUInt16BE(crc(content), 0);
119
119
 
@@ -227,7 +227,7 @@ function createSocket(bus) {
227
227
  socket.on('listening', function() {
228
228
  var address = socket.address();
229
229
 
230
- bus.address = new Buffer(address.address.split('.'));
230
+ bus.address = Buffer.from(address.address.split('.'));
231
231
 
232
232
  debug('UDP Server is listening on ' + address.address + ':' + address.port);
233
233
 
package/lib/command.js CHANGED
@@ -99,7 +99,7 @@ function encode() {
99
99
  var length = 11;
100
100
  var sender = this.sender;
101
101
  var target = this.target;
102
- var header = new Buffer(9);
102
+ var header = Buffer.allocUnsafe(9);
103
103
  var payload = this.payload;
104
104
 
105
105
  if (payload) length += payload.length;