zigbee-herdsman-converters 14.0.694 → 15.0.1
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/README.md +5 -0
- package/devices/philips.js +7 -0
- package/lib/ota/common.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
# zigbee-herdsman-converters
|
|
4
4
|
Collection of device converters to be used with zigbee-herdsman.
|
|
5
5
|
|
|
6
|
+
## Breaking changes
|
|
7
|
+
15.0.0
|
|
8
|
+
- OTA `isUpdateAvailable` now returns an object instead of a boolean (e.g. `{available: true, currentFileVersion: 120, otaFileVersion: 125}`)
|
|
9
|
+
- OTA `updateToLatest` now returns a number (`fileVersion` of the new OTA) instead of a void
|
|
10
|
+
|
|
6
11
|
## Contributing
|
|
7
12
|
See [Zigbee2MQTT how to support new devices](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html).
|
|
8
13
|
|
package/devices/philips.js
CHANGED
|
@@ -404,6 +404,13 @@ module.exports = [
|
|
|
404
404
|
description: 'Hue Iris copper special edition (generation 4) ',
|
|
405
405
|
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
406
406
|
},
|
|
407
|
+
{
|
|
408
|
+
zigbeeModel: ['929002376803'],
|
|
409
|
+
model: '929002376803',
|
|
410
|
+
vendor: 'Philips',
|
|
411
|
+
description: 'Hue Iris copper special edition (generation 4)',
|
|
412
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
413
|
+
},
|
|
407
414
|
{
|
|
408
415
|
zigbeeModel: ['5063130P7'],
|
|
409
416
|
model: '5063130P7',
|
package/lib/ota/common.js
CHANGED
|
@@ -258,7 +258,7 @@ async function isUpdateAvailable(device, logger, isNewImageAvailable, requestPay
|
|
|
258
258
|
if (available > 0) {
|
|
259
259
|
logger.warn(`Firmware on '${device.ieeeAddr}' is newer than latest firmware online.`);
|
|
260
260
|
}
|
|
261
|
-
return
|
|
261
|
+
return {...available, available: available < 0};
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
async function isNewImageAvailable(current, logger, device, getImageMeta) {
|
|
@@ -270,7 +270,11 @@ async function isNewImageAvailable(current, logger, device, getImageMeta) {
|
|
|
270
270
|
return -1; // Negative number means the new firmware is 'newer' than current one
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
return
|
|
273
|
+
return {
|
|
274
|
+
available: Math.sign(current.fileVersion - meta.fileVersion),
|
|
275
|
+
currentFileVersion: current.fileVersion,
|
|
276
|
+
otaFileVersion: meta.fileVersion,
|
|
277
|
+
};
|
|
274
278
|
}
|
|
275
279
|
|
|
276
280
|
async function updateToLatest(device, logger, onProgress, getNewImage, getImageMeta = null, downloadImage = null) {
|
|
@@ -393,7 +397,7 @@ async function updateToLatest(device, logger, onProgress, getNewImage, getImageM
|
|
|
393
397
|
logger.debug('Got device announce or timed out, call resolve');
|
|
394
398
|
clearInterval(timer);
|
|
395
399
|
device.removeListener('deviceAnnounce', cb);
|
|
396
|
-
resolve();
|
|
400
|
+
resolve(image.header.fileVersion);
|
|
397
401
|
};
|
|
398
402
|
timer = setTimeout(cb, 120 * 1000); // timeout after 2 minutes
|
|
399
403
|
device.once('deviceAnnounce', cb);
|