Allow to use IKEA TRADFRI OTA test server. https://github.com/Koenkk/zigbee2mqtt/issues/2921

This commit is contained in:
Koen Kanters
2020-12-09 19:51:16 +01:00
parent c29ffcf39e
commit ab3fd769d5
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -3,6 +3,7 @@ const logger = require('../util/logger');
const stringify = require('json-stable-stringify-without-jsonify');
const utils = require('../util/utils');
const legacyTopicRegex = new RegExp(`^${settings.get().mqtt.base_topic}/bridge/ota_update/.+$`);
const tradfriOTA = require('zigbee-herdsman-converters/ota/tradfri');
const topicRegex =
new RegExp(`^${settings.get().mqtt.base_topic}/bridge/request/device/ota_update/(update|check)`, 'i');
@@ -15,6 +16,10 @@ class OTAUpdate extends Extension {
this.inProgress = new Set();
this.lastChecked = {};
this.legacyApi = settings.get().advanced.legacy_api;
if (settings.get().advanced.ikea_ota_use_test_url) {
tradfriOTA.useTestURL();
}
}
onMQTTConnected() {
+1
View File
@@ -19,6 +19,7 @@ describe('OTA update', () => {
beforeEach(async () => {
data.writeDefaultConfiguration();
settings._reRead();
settings.set(['advanced', 'ikea_ota_use_test_url'], true);
data.writeEmptyState();
controller = new Controller();
await controller.start();