diff --git a/README.md b/README.md index 3f227c3..b18deda 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,12 @@ You must enter these in the configuration of the adapter. ## Changelog + +### **WORK IN PROGRESS** +* (simatec) Translation Fix +* (simatec) Code cleaning +* (simatec) Ready for Betatest + ### 0.1.3 (2024-09-12) * (simatec) Fix Zonemode * (simatec) Translation added diff --git a/lib/tools.js b/lib/tools.js new file mode 100644 index 0000000..2ab48ae --- /dev/null +++ b/lib/tools.js @@ -0,0 +1,50 @@ +const crypto = require('crypto'); + +async function _translate(word, systemLang) { + return new Promise(async (resolve) => { + const translations = require(`../admin/i18n/${systemLang ? systemLang : 'en'}/translations.json`); + + if (translations[word]) { + resolve(translations[word]); + } else { + console.warn(`Please translate in translations.json: ${word}`); + resolve(word); + } + }); +} + +async function generateRandomToken(length) { + return new Promise(async (resolve) => { + const randomToken = crypto.randomBytes(length).toString('base64url'); + resolve(randomToken); + }); +} + +async function computeCodeChallenge(token) { + return new Promise(async (resolve) => { + const hash = crypto.createHash('sha256'); + hash.update(token); + const digest = hash.digest(); + + const base64Url = digest.toString('base64') + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/=+$/, ''); + + resolve(base64Url); + }); +} + +async function randomBytes(length) { + return new Promise(async (resolve) => { + const _randomBytes = crypto.randomBytes(length).toString('base64url'); + resolve(_randomBytes); + }); +} + +module.exports = { + _translate, + generateRandomToken, + computeCodeChallenge, + randomBytes, +}; \ No newline at end of file diff --git a/main.js b/main.js index ee3cc0a..b14a1e9 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ 'use strict'; const utils = require('@iobroker/adapter-core'); -const crypto = require('crypto'); +const tools = require('./lib/tools'); const { URL } = require('url'); const { CookieJar } = require('tough-cookie'); @@ -35,19 +35,6 @@ class RemehaHomeAdapter extends utils.Adapter { this.on('unload', this.onUnload); } - async loadGot() { - const { default: got } = await import('got'); - this.got = got; - this.client = this.got.extend({ - prefixUrl: 'https://remehalogin.bdrthermea.net', - timeout: { - connect: 2000, - request: 5000 - }, - cookieJar, - }); - } - async onReady() { this.log.info('Remeha Home Adapter started.'); @@ -72,6 +59,69 @@ class RemehaHomeAdapter extends utils.Adapter { this.schedulePoll(); } + async onStateChange(id, state) { + if (state && !this.getUpdate) { + if (id === `${this.namespace}.data.roomThermostat.setPoint`) { + if (!state?.ack) { + await this.setState('data.roomThermostat.setPoint', { val: state?.val, ack: true }); + } else { + + const postData = { + roomTemperatureSetPoint: state.val + }; + this.setValues('setPoint', postData); + } + } + + if (id === `${this.namespace}.data.roomThermostat.setZoneMode`) { + if (!state?.ack) { + await this.setState('data.roomThermostat.setZoneMode', { val: state?.val, ack: true }); + } else { + let mode = ''; + + switch (state.val) { + case 'Scheduling': + mode = 'schedule' + break; + case 'Manual': + mode = 'manual' + break; + case 'FrostProtection': + mode = 'anti-frost'; + break; + + } + const postData = { + zoneMode: state.val, + value: mode, + }; + this.setValues('zoneMode', postData); + } + } + + if (id === `${this.namespace}.data.roomThermostat.firePlaceModeActive`) { + if (!state?.ack) { + await this.setState('data.roomThermostat.firePlaceModeActive', { val: state?.val, ack: true }); + } else { + const postData = { + fireplaceModeActive: state.val + }; + this.setValues('fireplaceModeActive', postData); + } + } + } + } + + onUnload(callback) { + try { + this.setState('info.connection', false, true); + this.clearInterval(this.interval); + callback(); + } catch (e) { + callback(); + } + } + async createDevices() { const states = [ { id: 'data.roomThermostat.roomTemperature', name: 'Room Temperature', read: true, write: false, type: 'number', role: 'value.temperature', unit: '°C' }, @@ -83,8 +133,8 @@ class RemehaHomeAdapter extends utils.Adapter { { id: 'data.dhw.dhwStatus', name: 'DHW Status', read: true, write: false, type: 'string', role: 'value' }, { id: 'data.dhw.name', name: 'DHW Name', read: true, write: false, type: 'string', role: 'value' }, { id: 'data.dhw.gasCalorificValue', name: 'Gas Calorific Value', read: true, write: false, type: 'number', role: 'value.power', unit: 'kWh/m³' }, - { id: 'data.roomThermostat.name', name: ' Thermostat Name', read: true, write: false, type: 'string', role: 'value' }, - { id: 'data.roomThermostat.setZoneMode', name: 'Set Zone Mode', role: 'level.mode.thermostat', read: true, write: true, type: 'string', states: { 'Scheduling': this.translate('Scheduling', systemLang), 'Manual': this.translate('Manual', systemLang), 'FrostProtection': this.translate('FrostProtection', systemLang) } }, + { id: 'data.roomThermostat.name', name: 'Thermostat Name', read: true, write: false, type: 'string', role: 'value' }, + { id: 'data.roomThermostat.setZoneMode', name: 'Set Zone Mode', role: 'level.mode.thermostat', read: true, write: true, type: 'string', states: { 'Scheduling': tools._translate('Scheduling', systemLang), 'Manual': tools._translate('Manual', systemLang), 'FrostProtection': tools._translate('FrostProtection', systemLang) } }, { id: 'data.roomThermostat.currentZoneMode', name: 'Current Zone Mode', role: 'level.mode.thermostat', read: true, write: false, type: 'string' }, { id: 'data.dhw.waterPressureOK', name: 'Water Pressure OK', read: true, write: false, role: 'switch', type: 'boolean' }, { id: 'data.roomThermostat.firePlaceModeActive', name: 'Fireplace Mode Active', read: true, write: true, role: 'switch', type: 'boolean' }, @@ -103,7 +153,7 @@ class RemehaHomeAdapter extends utils.Adapter { await this.setObjectNotExistsAsync(state.id, { type: 'state', common: { - name: this.translate(state.name, systemLang), + name: tools._translate(state.name, systemLang), type: state.type || 'number', role: state.role, unit: state.unit || '', @@ -116,17 +166,6 @@ class RemehaHomeAdapter extends utils.Adapter { } } - translate(word, systemLang) { - const translations = require(`./admin/i18n/${systemLang ? systemLang : 'en'}/translations.json`); - - if (translations[word]) { - return translations[word]; - } else { - this.log.warn(`Please translate in translations.json: ${word}`); - return word; - } - } - schedulePoll() { this.poll(); this.interval = setInterval(() => this.poll(), this.pollInterval * 1000); @@ -147,14 +186,27 @@ class RemehaHomeAdapter extends utils.Adapter { } } + async loadGot() { + const { default: got } = await import('got'); + this.got = got; + this.client = this.got.extend({ + prefixUrl: 'https://remehalogin.bdrthermea.net', + timeout: { + connect: 2000, + request: 5000 + }, + cookieJar, + }); + } + async resolveExternalData() { try { - this.state = crypto.randomBytes(32).toString('base64url'); - const codeChallenge = await this.generateRandomToken(64); + this.state = await tools.randomBytes(32); + const codeChallenge = await tools.generateRandomToken(64); this.codeChallenge = codeChallenge; - const codeChallengeSha256 = await this.computeCodeChallenge(codeChallenge); + const codeChallengeSha256 = await tools.computeCodeChallenge(codeChallenge); - const response = await this.client.get(`bdrb2cprod.onmicrosoft.com/oauth2/v2.0/authorize?`, { + const response = await this.client.get('bdrb2cprod.onmicrosoft.com/oauth2/v2.0/authorize?', { searchParams: { response_type: 'code', client_id: '6ce007c6-0628-419e-88f4-bee2e6418eec', @@ -212,7 +264,7 @@ class RemehaHomeAdapter extends utils.Adapter { async login(stateProperties, csrfToken) { try { - const response = await this.client.post(`bdrb2cprod.onmicrosoft.com/B2C_1A_RPSignUpSignInNewRoomv3.1/SelfAsserted`, { + const response = await this.client.post('bdrb2cprod.onmicrosoft.com/B2C_1A_RPSignUpSignInNewRoomv3.1/SelfAsserted', { searchParams: { tx: `StateProperties=${stateProperties}`, p: 'B2C_1A_RPSignUpSignInNewRoomv3.1', @@ -239,8 +291,7 @@ class RemehaHomeAdapter extends utils.Adapter { } try { - const url = `bdrb2cprod.onmicrosoft.com/B2C_1A_RPSignUpSignInNewRoomv3.1/api/CombinedSigninAndSignup/confirmed`; - const response = await this.client.get(url, { + const response = await this.client.get('bdrb2cprod.onmicrosoft.com/B2C_1A_RPSignUpSignInNewRoomv3.1/api/CombinedSigninAndSignup/confirmed', { searchParams: { rememberMe: 'false', csrf_token: csrfToken, @@ -276,23 +327,6 @@ class RemehaHomeAdapter extends utils.Adapter { } } - async generateRandomToken(length) { - return crypto.randomBytes(length).toString('base64url'); - } - - async computeCodeChallenge(token) { - const hash = crypto.createHash('sha256'); - hash.update(token); - const digest = hash.digest(); - - const base64Url = digest.toString('base64') - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=+$/, ''); - - return base64Url; - } - async fetchAccessToken(code) { try { const grantParams = { @@ -361,7 +395,7 @@ class RemehaHomeAdapter extends utils.Adapter { const data = JSON.parse(response.body); const _zoneMode = data.appliances[0].climateZones[0].zoneMode; - const _zoneModeTranslate = this.translate(_zoneMode, systemLang); + const _zoneModeTranslate = await tools._translate(_zoneMode, systemLang); await this.setState('data.roomThermostat.roomTemperature', { val: data.appliances[0].climateZones[0].roomTemperature, ack: true }); await this.setState('data.dhw.outdoorTemperature', { val: data.appliances[0].outdoorTemperature, ack: true }); @@ -518,72 +552,6 @@ class RemehaHomeAdapter extends utils.Adapter { } } } - - async onStateChange(id, state) { - if (state && !this.getUpdate) { - if (id === `${this.namespace}.data.roomThermostat.setPoint`) { - if (!state?.ack) { - await this.setState('data.roomThermostat.setPoint', { val: state?.val, ack: true }); - } else { - - const postData = { - roomTemperatureSetPoint: state.val - }; - this.setValues('setPoint', postData); - } - } - - if (id === `${this.namespace}.data.roomThermostat.setZoneMode`) { - if (!state?.ack) { - await this.setState('data.roomThermostat.setZoneMode', { val: state?.val, ack: true }); - } else { - let mode = ''; - - switch (state.val) { - case 'Scheduling': - mode = 'schedule' - break; - case 'Manual': - mode = 'manual' - break; - case 'TemporaryOverride': - mode = 'temporary-override'; - break; - case 'FrostProtection': - mode = 'anti-frost'; - break; - - } - const postData = { - zoneMode: state.val, - value: mode, - }; - this.setValues('zoneMode', postData); - } - } - - if (id === `${this.namespace}.data.roomThermostat.firePlaceModeActive`) { - if (!state?.ack) { - await this.setState('data.roomThermostat.firePlaceModeActive', { val: state?.val, ack: true }); - } else { - const postData = { - fireplaceModeActive: state.val - }; - this.setValues('fireplaceModeActive', postData); - } - } - } - } - - onUnload(callback) { - try { - this.setState('info.connection', false, true); - this.clearInterval(this.interval); - callback(); - } catch (e) { - callback(); - } - } } if (module.parent) { diff --git a/package-lock.json b/package-lock.json index 6cfd239..13ea7c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@alcalzone/release-script-plugin-license": "^3.7.0", "@alcalzone/release-script-plugin-manual-review": "^3.7.0", "@iobroker/adapter-dev": "^1.3.0", - "@iobroker/testing": "^4.1.3", + "@iobroker/testing": "^5.0.0", "chai": "^4.5.0", "chai-as-promised": "^7.1.2", "eslint": "^9.10.0", @@ -1003,64 +1003,64 @@ } }, "node_modules/@iobroker/testing": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@iobroker/testing/-/testing-4.1.3.tgz", - "integrity": "sha512-PTfvlXQBXDJVX35bkJxzgjuMX6bEjUmB4Dy8+bWLqbOgyq1JQVrRn+ah5IB7hEf+4lP8wD0MpAjXFJTv3zfTvA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@iobroker/testing/-/testing-5.0.0.tgz", + "integrity": "sha512-JrtWaGrgTU5MGRZowwyrDHVz8nzh/1QUqiOo1g9SXrRwT3PH0f6wRQKfe/RKiULFD2O4N3isc7pqyZg/uv4wdA==", "dev": true, "dependencies": { - "alcalzone-shared": "~4.0.3", - "chai": "^4.3.7", - "chai-as-promised": "^7.1.1", - "debug": "^4.3.4", - "fs-extra": "^10.1.0", - "mocha": "^10.2.0", - "sinon": "^15.0.1", + "alcalzone-shared": "~4.0.8", + "chai": "^4.5.0", + "chai-as-promised": "^7.1.2", + "debug": "^4.3.7", + "fs-extra": "^11.2.0", + "mocha": "^10.7.3", + "sinon": "^19.0.2", "sinon-chai": "^3.7.0" } }, "node_modules/@iobroker/testing/node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.2.tgz", + "integrity": "sha512-4Bb+oqXZTSTZ1q27Izly9lv8B9dlV61CROxPiVtywwzv5SnytJqhvYe6FclHYuXml4cd1VHPo1zd5PmTeJozvA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^3.0.0" + "@sinonjs/commons": "^3.0.1" } }, - "node_modules/@iobroker/testing/node_modules/nise": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", - "integrity": "sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==", + "node_modules/@iobroker/testing/node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/text-encoding": "^0.7.2", - "just-extend": "^6.2.0", - "path-to-regexp": "^6.2.1" + "engines": { + "node": ">=0.3.1" } }, - "node_modules/@iobroker/testing/node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", - "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", + "node_modules/@iobroker/testing/node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, "dependencies": { - "@sinonjs/commons": "^3.0.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" } }, "node_modules/@iobroker/testing/node_modules/sinon": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.2.0.tgz", - "integrity": "sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==", - "deprecated": "16.1.1", + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-19.0.2.tgz", + "integrity": "sha512-euuToqM+PjO4UgXeLETsfQiuoyPXlqFezr6YZDFwHR3t4qaX0fZUe1MfPMznTL5f8BWrVS89KduLdMUsxFCO6g==", "dev": true, "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^10.3.0", - "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.4", + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.2", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "nise": "^6.1.1", "supports-color": "^7.2.0" }, "funding": { @@ -1223,29 +1223,29 @@ } }, "node_modules/@sinonjs/samsam": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz", - "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", + "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0", + "@sinonjs/commons": "^3.0.1", "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" } }, - "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "dev": true, - "dependencies": { - "type-detect": "4.0.8" + "engines": { + "node": ">=4" } }, "node_modules/@sinonjs/text-encoding": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", - "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", + "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", "dev": true }, "node_modules/@szmarczak/http-timer": { @@ -1859,12 +1859,12 @@ } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3603,12 +3603,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -3643,9 +3637,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/natural-compare": { @@ -3655,16 +3649,25 @@ "dev": true }, "node_modules/nise": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-6.0.0.tgz", - "integrity": "sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz", + "integrity": "sha512-aMSAzLVY7LyeM60gvBS423nBmIPP+Wy7St7hsb+8/fc1HmeoHJfLO8CKse4u3BtOZvQLJghYPI2i/1WZrEj5/g==", "dev": true, "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/text-encoding": "^0.7.2", + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.1", + "@sinonjs/text-encoding": "^0.7.3", "just-extend": "^6.2.0", - "path-to-regexp": "^6.2.1" + "path-to-regexp": "^8.1.0" + } + }, + "node_modules/nise/node_modules/@sinonjs/fake-timers": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.2.tgz", + "integrity": "sha512-4Bb+oqXZTSTZ1q27Izly9lv8B9dlV61CROxPiVtywwzv5SnytJqhvYe6FclHYuXml4cd1VHPo1zd5PmTeJozvA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.1" } }, "node_modules/node-fetch": { @@ -3858,10 +3861,13 @@ } }, "node_modules/path-to-regexp": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", - "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==", - "dev": true + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.1.0.tgz", + "integrity": "sha512-Bqn3vc8CMHty6zuD+tG23s6v2kwxslHEhTj4eYaVKGIEB+YX/2wd0/rgXLFD9G9id9KCtbVy/3ZgmvZjpa0UdQ==", + "dev": true, + "engines": { + "node": ">=16" + } }, "node_modules/pathval": { "version": "1.1.1", diff --git a/package.json b/package.json index 6c98235..72623f6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@alcalzone/release-script-plugin-license": "^3.7.0", "@alcalzone/release-script-plugin-manual-review": "^3.7.0", "@iobroker/adapter-dev": "^1.3.0", - "@iobroker/testing": "^4.1.3", + "@iobroker/testing": "^5.0.0", "chai": "^4.5.0", "chai-as-promised": "^7.1.2", "eslint": "^9.10.0",