iobroker.comfoairq
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"i18n": true, | ||
"type": "tabs", | ||
"iconPosition": "top", | ||
"items": { | ||
@@ -8,2 +9,3 @@ "_options": { | ||
"label": "Options", | ||
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNNDk1LjkgMTY2LjZjMy4yIDguNyAuNSAxOC40LTYuNCAyNC42bC00My4zIDM5LjRjMS4xIDguMyAxLjcgMTYuOCAxLjcgMjUuNHMtLjYgMTcuMS0xLjcgMjUuNGw0My4zIDM5LjRjNi45IDYuMiA5LjYgMTUuOSA2LjQgMjQuNmMtNC40IDExLjktOS43IDIzLjMtMTUuOCAzNC4zbC00LjcgOC4xYy02LjYgMTEtMTQgMjEuNC0yMi4xIDMxLjJjLTUuOSA3LjItMTUuNyA5LjYtMjQuNSA2LjhsLTU1LjctMTcuN2MtMTMuNCAxMC4zLTI4LjIgMTguOS00NCAyNS40bC0xMi41IDU3LjFjLTIgOS4xLTkgMTYuMy0xOC4yIDE3LjhjLTEzLjggMi4zLTI4IDMuNS00Mi41IDMuNXMtMjguNy0xLjItNDIuNS0zLjVjLTkuMi0xLjUtMTYuMi04LjctMTguMi0xNy44bC0xMi41LTU3LjFjLTE1LjgtNi41LTMwLjYtMTUuMS00NC0yNS40TDgzLjEgNDI1LjljLTguOCAyLjgtMTguNiAuMy0yNC41LTYuOGMtOC4xLTkuOC0xNS41LTIwLjItMjIuMS0zMS4ybC00LjctOC4xYy02LjEtMTEtMTEuNC0yMi40LTE1LjgtMzQuM2MtMy4yLTguNy0uNS0xOC40IDYuNC0yNC42bDQzLjMtMzkuNEM2NC42IDI3My4xIDY0IDI2NC42IDY0IDI1NnMuNi0xNy4xIDEuNy0yNS40TDIyLjQgMTkxLjJjLTYuOS02LjItOS42LTE1LjktNi40LTI0LjZjNC40LTExLjkgOS43LTIzLjMgMTUuOC0zNC4zbDQuNy04LjFjNi42LTExIDE0LTIxLjQgMjIuMS0zMS4yYzUuOS03LjIgMTUuNy05LjYgMjQuNS02LjhsNTUuNyAxNy43YzEzLjQtMTAuMyAyOC4yLTE4LjkgNDQtMjUuNGwxMi41LTU3LjFjMi05LjEgOS0xNi4zIDE4LjItMTcuOEMyMjcuMyAxLjIgMjQxLjUgMCAyNTYgMHMyOC43IDEuMiA0Mi41IDMuNWM5LjIgMS41IDE2LjIgOC43IDE4LjIgMTcuOGwxMi41IDU3LjFjMTUuOCA2LjUgMzAuNiAxNS4xIDQ0IDI1LjRsNTUuNy0xNy43YzguOC0yLjggMTguNi0uMyAyNC41IDYuOGM4LjEgOS44IDE1LjUgMjAuMiAyMi4xIDMxLjJsNC43IDguMWM2LjEgMTEgMTEuNCAyMi40IDE1LjggMzQuM3pNMjU2IDMzNmE4MCA4MCAwIDEgMCAwLTE2MCA4MCA4MCAwIDEgMCAwIDE2MHoiLz48L3N2Zz4=", | ||
"items": { | ||
@@ -66,9 +68,12 @@ "multicastAddr": { | ||
"label": "Sensors", | ||
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMTc2IDI0YzAtMTMuMy0xMC43LTI0LTI0LTI0cy0yNCAxMC43LTI0IDI0VjY0Yy0zNS4zIDAtNjQgMjguNy02NCA2NEgyNGMtMTMuMyAwLTI0IDEwLjctMjQgMjRzMTAuNyAyNCAyNCAyNEg2NHY1NkgyNGMtMTMuMyAwLTI0IDEwLjctMjQgMjRzMTAuNyAyNCAyNCAyNEg2NHY1NkgyNGMtMTMuMyAwLTI0IDEwLjctMjQgMjRzMTAuNyAyNCAyNCAyNEg2NGMwIDM1LjMgMjguNyA2NCA2NCA2NHY0MGMwIDEzLjMgMTAuNyAyNCAyNCAyNHMyNC0xMC43IDI0LTI0VjQ0OGg1NnY0MGMwIDEzLjMgMTAuNyAyNCAyNCAyNHMyNC0xMC43IDI0LTI0VjQ0OGg1NnY0MGMwIDEzLjMgMTAuNyAyNCAyNCAyNHMyNC0xMC43IDI0LTI0VjQ0OGMzNS4zIDAgNjQtMjguNyA2NC02NGg0MGMxMy4zIDAgMjQtMTAuNyAyNC0yNHMtMTAuNy0yNC0yNC0yNEg0NDhWMjgwaDQwYzEzLjMgMCAyNC0xMC43IDI0LTI0cy0xMC43LTI0LTI0LTI0SDQ0OFYxNzZoNDBjMTMuMyAwIDI0LTEwLjcgMjQtMjRzLTEwLjctMjQtMjQtMjRINDQ4YzAtMzUuMy0yOC43LTY0LTY0LTY0VjI0YzAtMTMuMy0xMC43LTI0LTI0LTI0cy0yNCAxMC43LTI0IDI0VjY0SDI4MFYyNGMwLTEzLjMtMTAuNy0yNC0yNC0yNHMtMjQgMTAuNy0yNCAyNFY2NEgxNzZWMjR6TTE2MCAxMjhIMzUyYzE3LjcgMCAzMiAxNC4zIDMyIDMyVjM1MmMwIDE3LjctMTQuMyAzMi0zMiAzMkgxNjBjLTE3LjcgMC0zMi0xNC4zLTMyLTMyVjE2MGMwLTE3LjcgMTQuMy0zMiAzMi0zMnptMTkyIDMySDE2MFYzNTJIMzUyVjE2MHoiLz48L3N2Zz4=", | ||
"items": { | ||
"sensor_16": { | ||
"type": "checkbox", | ||
"_headerSensorsOperation": { | ||
"newLine": true, | ||
"type": "header", | ||
"text": "Operation", | ||
"size": 3, | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_AWAY_INDICATOR (16)" | ||
"md": 12, | ||
"lg": 12 | ||
}, | ||
@@ -89,2 +94,11 @@ "sensor_49": { | ||
}, | ||
"_headerSensorsFans": { | ||
"newLine": true, | ||
"type": "header", | ||
"text": "Fans", | ||
"size": 3, | ||
"sm": 12, | ||
"md": 12, | ||
"lg": 12 | ||
}, | ||
"sensor_65": { | ||
@@ -97,16 +111,2 @@ "type": "checkbox", | ||
}, | ||
"sensor_66": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_BYPASS_ACTIVATION_MODE (66)" | ||
}, | ||
"sensor_67": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_PROFILE (67)" | ||
}, | ||
"sensor_81": { | ||
@@ -161,2 +161,85 @@ "type": "checkbox", | ||
}, | ||
"_headerSensorsTemperatures": { | ||
"newLine": true, | ||
"type": "header", | ||
"text": "Temperatures", | ||
"size": 3, | ||
"sm": 12, | ||
"md": 12, | ||
"lg": 12 | ||
}, | ||
"sensor_221": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_SUPPLY (221)" | ||
}, | ||
"sensor_274": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_EXTRACT (274)" | ||
}, | ||
"sensor_275": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_EXHAUST (275)" | ||
}, | ||
"sensor_276": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_OUTDOOR (276)" | ||
}, | ||
"_headerSensorsHumidities": { | ||
"newLine": true, | ||
"type": "header", | ||
"text": "Humidities", | ||
"size": 3, | ||
"sm": 12, | ||
"md": 12, | ||
"lg": 12 | ||
}, | ||
"sensor_290": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_EXTRACT (290)" | ||
}, | ||
"sensor_291": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_EXHAUST (291)" | ||
}, | ||
"sensor_292": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_OUTDOOR (292)" | ||
}, | ||
"sensor_294": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_SUPPLY (294)" | ||
}, | ||
"_headerSensorsPower": { | ||
"newLine": true, | ||
"type": "header", | ||
"text": "Power", | ||
"size": 3, | ||
"sm": 12, | ||
"md": 12, | ||
"lg": 12 | ||
}, | ||
"sensor_128": { | ||
@@ -204,16 +287,2 @@ "type": "checkbox", | ||
}, | ||
"sensor_192": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_DAYS_TO_REPLACE_FILTER (192)" | ||
}, | ||
"sensor_209": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_CURRENT_RMOT (209)" | ||
}, | ||
"sensor_213": { | ||
@@ -261,10 +330,12 @@ "type": "checkbox", | ||
}, | ||
"sensor_221": { | ||
"type": "checkbox", | ||
"_headerSensorsOther": { | ||
"newLine": true, | ||
"type": "header", | ||
"text": "Other", | ||
"size": 3, | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_SUPPLY (221)" | ||
"md": 12, | ||
"lg": 12 | ||
}, | ||
"sensor_227": { | ||
"sensor_16": { | ||
"type": "checkbox", | ||
@@ -274,5 +345,6 @@ "sm": 12, | ||
"lg": 4, | ||
"label": "SENSOR_BYPASS_STATE (227)" | ||
"label": "SENSOR_AWAY_INDICATOR (16)" | ||
}, | ||
"sensor_274": { | ||
"sensor_66": { | ||
"type": "checkbox", | ||
@@ -282,5 +354,5 @@ "sm": 12, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_EXTRACT (274)" | ||
"label": "SENSOR_BYPASS_ACTIVATION_MODE (66)" | ||
}, | ||
"sensor_275": { | ||
"sensor_67": { | ||
"type": "checkbox", | ||
@@ -290,5 +362,6 @@ "sm": 12, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_EXHAUST (275)" | ||
"label": "SENSOR_TEMPERATURE_PROFILE (67)" | ||
}, | ||
"sensor_276": { | ||
"sensor_192": { | ||
"type": "checkbox", | ||
@@ -298,5 +371,5 @@ "sm": 12, | ||
"lg": 4, | ||
"label": "SENSOR_TEMPERATURE_OUTDOOR (276)" | ||
"label": "SENSOR_DAYS_TO_REPLACE_FILTER (192)" | ||
}, | ||
"sensor_290": { | ||
"sensor_209": { | ||
"type": "checkbox", | ||
@@ -306,5 +379,5 @@ "sm": 12, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_EXTRACT (290)" | ||
"label": "SENSOR_CURRENT_RMOT (209)" | ||
}, | ||
"sensor_291": { | ||
"sensor_227": { | ||
"type": "checkbox", | ||
@@ -314,17 +387,3 @@ "sm": 12, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_EXHAUST (291)" | ||
}, | ||
"sensor_292": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_OUTDOOR (292)" | ||
}, | ||
"sensor_294": { | ||
"type": "checkbox", | ||
"sm": 12, | ||
"md": 6, | ||
"lg": 4, | ||
"label": "SENSOR_HUMIDITY_SUPPLY (294)" | ||
"label": "SENSOR_BYPASS_STATE (227)" | ||
} | ||
@@ -331,0 +390,0 @@ } |
{ | ||
"common": { | ||
"name": "comfoairq", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"news": { | ||
"0.4.0": { | ||
"en": "NodeJS >= 18.x and js-controller >= 5 is required\n\n* Added icons to admin tabs\n* Group sensors in admin config\n* Limit sensor value refresh interval", | ||
"de": "NodeJS >= 18.x und js-Controller >= 5 ist erforderlich\n\n* Icons zu Admin-Tabs hinzugefügt\n* Gruppensensoren in admin config\n* Grenzwert-Sensorwert-Erfrischungsintervall", | ||
"ru": "NodeJS >= 18.x и js-контроллер >= 5 требуется\n\n* Добавлены иконки в вкладки администратора\n* Групповые датчики в конфигурации администратора\n* Интервал обновления предельного значения датчика", | ||
"pt": "NodeJS >= 18.x e js-controller >= 5 é necessário\n\n* Ícones adicionados para guias de administrador\n* Sensores de grupo em admin config\n* Limitar o intervalo de atualização do valor do sensor", | ||
"nl": "Voor de toepassing van de onderverdelingen 870190 tot en met 870290 wordt onder post 8702 verstaan: 5 is vereist\n\n* Pictogrammen toegevoegd aan admintabbladen\n* Groep sensoren in admin configuratie\n* Beperk sensorwaarde herhalingsinterval", | ||
"fr": "NodeJS >= 18.x et js-controller >= 5 est nécessaire\n\n* Ajout d'icônes aux onglets admin\n* Capteurs de groupe en configuration admin\n* Limiter l'intervalle de rafraîchissement de la valeur du capteur", | ||
"it": "NodeJS >= 18.x e js-controller 5 è richiesto\n\n* Aggiunte icone a schede di amministrazione\n* Sensori di gruppo nella configurazione di admin\n* Intervallo di aggiornamento del valore del sensore di limite", | ||
"es": "NodeJS >= 18.x y js-controller Se requiere 5\n\n* iconos añadidos a pestañas de administración\n* Sensores de grupo en configuración de administración\n* intervalo de actualización del valor del sensor límite", | ||
"pl": "NodeJS > = 18.x i kontroler js- > = 5 jest wymagane\n\n* Dodano ikony do kart admin\n* Czujniki grupowe w konfiguracji admin\n* Limit wartości czujnika odświeżania interwał", | ||
"uk": "NodeJS >= 18.x та js-controller >= 5 обов'язково\n\n* Додано іконки для вкладок адміністратора\n* Датчики групи в налаштуваннях адміністратора\n* інтервал оновлення значення датчика", | ||
"zh-cn": "节点JS18x和js控制器QQ 需要5个\n\n* 添加到管理标签的图标\n* 管理员配置中的组传感器\n* 限制传感器值刷新间隔" | ||
}, | ||
"0.3.0": { | ||
@@ -83,15 +96,2 @@ "en": "NodeJS 14.x is required (NodeJS 12.x is EOL)\n\n* Updated depedency for js-controller to 4.0.15\n* Dropped Admin 5 support\n* Added Ukrainian language", | ||
"uk": "Перше підключення" | ||
}, | ||
"0.0.1": { | ||
"en": "initial release", | ||
"de": "Erstveröffentlichung", | ||
"ru": "Первый выпуск", | ||
"pt": "lançamento inicial", | ||
"nl": "Eerste uitgave", | ||
"fr": "Première version", | ||
"it": "Versione iniziale", | ||
"es": "Versión inicial", | ||
"pl": "Pierwsze wydanie", | ||
"zh-cn": "初始发行", | ||
"uk": "початковий випуск" | ||
} | ||
@@ -134,3 +134,7 @@ }, | ||
], | ||
"license": "MIT", | ||
"tier": 3, | ||
"licenseInformation": { | ||
"license": "MIT", | ||
"type": "free" | ||
}, | ||
"platform": "Javascript/Node.js", | ||
@@ -152,3 +156,3 @@ "icon": "comfoairq.png", | ||
{ | ||
"js-controller": ">=4.0.15" | ||
"js-controller": ">=5.0.0" | ||
} | ||
@@ -169,3 +173,3 @@ ], | ||
"native": { | ||
"pin": "0000", | ||
"pin": "", | ||
"port": "56747", | ||
@@ -172,0 +176,0 @@ "multicastAddr": "192.168.1.255", |
162
main.js
@@ -1,4 +0,1 @@ | ||
/* jshint -W097 */ | ||
/* jshint strict: false */ | ||
/* jslint node: true */ | ||
'use strict'; | ||
@@ -28,32 +25,33 @@ | ||
this.sensorUnits = { | ||
117: '%', | ||
118: '%', | ||
119: 'm³/h', | ||
120: 'm³/h', | ||
121: 'rpm', | ||
122: 'rpm', | ||
128: 'W', | ||
129: 'kWh', | ||
130: 'kWh', | ||
144: 'kWh', | ||
145: 'kWh', | ||
146: 'W', | ||
192: 'days', | ||
209: '°C', | ||
213: 'W', | ||
214: 'kWh', | ||
215: 'kWh', | ||
216: 'W', | ||
217: 'kWh', | ||
218: 'kWh', | ||
221: '°C', | ||
227: '%', | ||
274: '°C', | ||
275: '°C', | ||
276: '°C', | ||
290: '%', | ||
291: '%', | ||
292: '%', | ||
294: '%', | ||
this.pausedSensorValues = {}; | ||
this.sensorMeta = { | ||
117: { unit: '%' }, | ||
118: { unit: '%' }, | ||
119: { unit: 'm³/h' }, | ||
120: { unit: 'm³/h' }, | ||
121: { unit: 'rpm' }, | ||
122: { unit: 'rpm' }, | ||
128: { unit: 'W' }, | ||
129: { unit: 'kWh' }, | ||
130: { unit: 'kWh' }, | ||
144: { unit: 'kWh' }, | ||
145: { unit: 'kWh' }, | ||
146: { unit: 'W' }, | ||
192: { unit: 'days' }, | ||
209: { unit: '°C' }, | ||
213: { unit: 'W' }, | ||
214: { unit: 'kWh' }, | ||
215: { unit: 'kWh' }, | ||
216: { unit: 'W' }, | ||
217: { unit: 'kWh' }, | ||
218: { unit: 'kWh' }, | ||
221: { unit: '°C' }, | ||
227: { unit: '%' }, | ||
274: { unit: '°C' }, | ||
275: { unit: '°C' }, | ||
276: { unit: '°C' }, | ||
290: { unit: '%' }, | ||
291: { unit: '%' }, | ||
292: { unit: '%' }, | ||
294: { unit: '%' }, | ||
}; | ||
@@ -71,4 +69,4 @@ | ||
for (const key of Object.keys(this.config)) { | ||
if (key.indexOf('sensor_') === 0 && this.config[key]) { | ||
this.sensors.push(Number(key.slice(7))); | ||
if (key.startsWith('sensor_') && this.config[key]) { | ||
this.sensors.push(Number(key.substring(7))); | ||
} | ||
@@ -105,25 +103,33 @@ } | ||
const sensorValue = data.result.data.data; | ||
const unit = Object.prototype.hasOwnProperty.call(this.sensorUnits, sensorId) ? this.sensorUnits[sensorId] : ''; | ||
await this.setObjectNotExistsAsync('sensor.' + sensorNameClean, { | ||
type: 'state', | ||
common: { | ||
name: sensorName + ' (' + sensorId + ')', | ||
type: 'number', | ||
role: 'value', | ||
unit: unit, | ||
read: true, | ||
write: false, | ||
}, | ||
native: { | ||
sensorId: sensorId, | ||
}, | ||
}); | ||
if (!isNaN(sensorValue)) { | ||
await this.extendObjectAsync(`sensor.${sensorNameClean}`, { | ||
type: 'state', | ||
common: { | ||
name: `${sensorName} (${sensorId})`, | ||
type: 'number', | ||
role: 'value', | ||
unit: this.sensorMeta?.[sensorId]?.unit, | ||
read: true, | ||
write: false, | ||
}, | ||
native: { | ||
sensorId: sensorId, | ||
}, | ||
}); | ||
await this.setStateAsync('sensor.' + sensorNameClean, { val: sensorValue, ack: true }); | ||
if (!Object.prototype.hasOwnProperty.call(this.pausedSensorValues, sensorId)) { | ||
await this.setStateChangedAsync(`sensor.${sensorNameClean}`, { val: sensorValue, ack: true }); | ||
this.pausedSensorValues[sensorId] = this.setTimeout(() => { | ||
//this.log.debug(``); | ||
delete this.pausedSensorValues[sensorId]; | ||
}, 2000); | ||
} | ||
} | ||
} else if (data.kind == 68) { | ||
// 68 = VersionConfirm | ||
await this.setStateAsync('version.comfonet', { val: data.result.data.comfoNetVersion.toString(), ack: true }); | ||
await this.setStateAsync('version.serial', { val: data.result.data.serialNumber.toString(), ack: true }); | ||
await this.setStateAsync('version.gateway', { val: data.result.data.gatewayVersion.toString(), ack: true }); | ||
await this.setStateChangedAsync('version.comfonet', { val: data.result.data.comfoNetVersion.toString(), ack: true }); | ||
await this.setStateChangedAsync('version.serial', { val: data.result.data.serialNumber.toString(), ack: true }); | ||
await this.setStateChangedAsync('version.gateway', { val: data.result.data.gatewayVersion.toString(), ack: true }); | ||
} | ||
@@ -139,3 +145,4 @@ } | ||
this.setStateAsync('info.connection', false, true); | ||
this.setState('info.connection', { val: false, ack: true }); | ||
this.connected = false; | ||
}); | ||
@@ -152,5 +159,5 @@ | ||
for (let i = 0; i < this.sensors.length; i++) { | ||
const registerResult = await this.zehnder.RegisterSensor(this.sensors[i]); | ||
this.log.debug(`Registered sensor "${this.sensors[i]}" with result: ${JSON.stringify(registerResult)}`); | ||
for (const sensor of this.sensors) { | ||
const registerResult = await this.zehnder.RegisterSensor(sensor); | ||
this.log.debug(`Registered sensor "${sensor}" with result: ${JSON.stringify(registerResult)}`); | ||
} | ||
@@ -160,4 +167,5 @@ | ||
await this.setStateAsync('info.connection', true, true); | ||
await this.setStateAsync('info.connection', { val: true, ack: true }); | ||
this.connected = true; | ||
this.subscribeStates('*'); | ||
@@ -184,4 +192,4 @@ } else { | ||
this.log.info(`[discovery] Device discovery finished - use these information for instance configuration: ${JSON.stringify(discoverResult)}`); | ||
} catch (ex) { | ||
this.log.error(`[discovery] error: ${JSON.stringify(ex)}`); | ||
} catch (err) { | ||
this.log.error(`[discovery] error: ${JSON.stringify(err)}`); | ||
} | ||
@@ -207,15 +215,2 @@ } else { | ||
onUnload(callback) { | ||
try { | ||
this.zehnder.CloseSession(); | ||
this.zehnder = null; | ||
this.setStateAsync('info.connection', false, true); | ||
callback(); | ||
} catch (e) { | ||
callback(); | ||
} | ||
} | ||
/** | ||
@@ -330,2 +325,21 @@ * Is called if a subscribed state changes | ||
} | ||
onUnload(callback) { | ||
try { | ||
this.zehnder.CloseSession(); | ||
this.zehnder = null; | ||
for (const [sensorId, timeout] of Object.entries(this.pausedSensorValues)) { | ||
this.log.debug(`Removing timeout for sensor ${sensorId}`); | ||
this.clearTimeout(timeout); | ||
} | ||
this.setStateAsync('info.connection', { val: false, ack: true }); | ||
this.connected = false; | ||
callback(); | ||
} catch (err) { | ||
callback(); | ||
} | ||
} | ||
} | ||
@@ -332,0 +346,0 @@ |
{ | ||
"name": "iobroker.comfoairq", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "ioBroker ComfoAirQ Adapter", | ||
@@ -25,33 +25,33 @@ "author": { | ||
"engines": { | ||
"node": ">=14.5.0" | ||
"node": ">=18" | ||
}, | ||
"dependencies": { | ||
"@iobroker/adapter-core": "^2.6.7", | ||
"@iobroker/adapter-core": "^3.0.6", | ||
"comfoairq": "^0.6.2" | ||
}, | ||
"devDependencies": { | ||
"@alcalzone/release-script": "^3.5.9", | ||
"@alcalzone/release-script-plugin-iobroker": "^3.5.9", | ||
"@alcalzone/release-script-plugin-license": "^3.5.9", | ||
"@iobroker/adapter-dev": "^1.2.0", | ||
"@iobroker/testing": "^4.1.0", | ||
"@types/chai": "^4.3.4", | ||
"@types/chai-as-promised": "^7.1.5", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.11.13", | ||
"@types/proxyquire": "^1.3.28", | ||
"@types/sinon": "^10.0.13", | ||
"@types/sinon-chai": "^3.2.9", | ||
"axios": "^0.27.2", | ||
"chai": "^4.3.7", | ||
"@alcalzone/release-script": "^3.7.0", | ||
"@alcalzone/release-script-plugin-iobroker": "^3.7.0", | ||
"@alcalzone/release-script-plugin-license": "^3.7.0", | ||
"@iobroker/adapter-dev": "^1.3.0", | ||
"@iobroker/testing": "^4.1.1", | ||
"@types/chai": "^4.3.14", | ||
"@types/chai-as-promised": "^7.1.8", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.11.30", | ||
"@types/proxyquire": "^1.3.31", | ||
"@types/sinon": "^17.0.3", | ||
"@types/sinon-chai": "^3.2.12", | ||
"axios": "^1.6.8", | ||
"chai": "^4.4.1", | ||
"chai-as-promised": "^7.1.1", | ||
"eslint": "^8.29.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"mocha": "^10.2.0", | ||
"prettier": "^2.8.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"mocha": "^10.4.0", | ||
"prettier": "^3.2.5", | ||
"proxyquire": "^2.1.3", | ||
"sinon": "^15.0.0", | ||
"sinon": "^17.0.1", | ||
"sinon-chai": "^3.7.0", | ||
"typescript": "~4.9.4" | ||
"typescript": "~5.4.3" | ||
}, | ||
@@ -58,0 +58,0 @@ "main": "main.js", |
@@ -7,3 +7,2 @@ ![Logo](admin/comfoairq.png) | ||
[![Downloads](https://img.shields.io/npm/dm/iobroker.comfoairq?label=npm%20downloads&style=flat-square)](https://www.npmjs.com/package/iobroker.comfoairq) | ||
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/iobroker.comfoairq?label=npm%20vulnerabilities&style=flat-square) | ||
![node-lts](https://img.shields.io/node/v-lts/iobroker.comfoairq?style=flat-square) | ||
@@ -17,4 +16,3 @@ ![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/iobroker.comfoairq?label=npm%20dependencies&style=flat-square) | ||
![GitHub issues](https://img.shields.io/github/issues/klein0r/iobroker.comfoairq?logo=github&style=flat-square) | ||
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/klein0r/iobroker.comfoairq/Test%20and%20Release?label=Test%20and%20Release&logo=github&style=flat-square) | ||
![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/klein0r/iobroker.comfoairq?label=repo%20vulnerabilities&logo=github&style=flat-square) | ||
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/klein0r/iobroker.comfoairq/test-and-release.yml?branch=master&logo=github&style=flat-square) | ||
@@ -35,3 +33,3 @@ ## Versions | ||
[![ioBroker Master Kurs](https://haus-automatisierung.com/images/ads/ioBroker-Kurs.png)](https://haus-automatisierung.com/iobroker-kurs/?refid=iobroker-comfoairq) | ||
[![ioBroker Master Kurs](https://haus-automatisierung.com/images/ads/ioBroker-Kurs.png?2024)](https://haus-automatisierung.com/iobroker-kurs/?refid=iobroker-comfoairq) | ||
@@ -44,2 +42,10 @@ ## Changelog | ||
--> | ||
### 0.4.0 (2024-03-28) | ||
NodeJS >= 18.x and js-controller >= 5 is required | ||
* (klein0r) Added icons to admin tabs | ||
* (klein0r) Group sensors in admin config | ||
* (klein0r) Limit sensor value refresh interval | ||
### 0.3.0 (2022-12-14) | ||
@@ -69,10 +75,2 @@ | ||
### 0.0.3 | ||
* (klein0r) Subscribe to sensors | ||
* (klein0r) Units for sensor values | ||
* (klein0r) Get version information | ||
* (klein0r) Control fan speed | ||
* (klein0r) Control fan boost | ||
## Credits | ||
@@ -90,3 +88,3 @@ | ||
Copyright (c) 2022 Matthias Kleine <info@haus-automatisierung.com> | ||
Copyright (c) 2024 Matthias Kleine <info@haus-automatisierung.com> | ||
@@ -93,0 +91,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
Sorry, the diff of this file is not supported yet
85185
874
102
+ Added@iobroker/adapter-core@3.1.6(transitive)
- Removed@iobroker/adapter-core@2.6.12(transitive)