Skip to content

Commit 8db482e

Browse files
authored
Merge pull request #294 from Grizzelbee/development
V3.2.1
2 parents 9eeb765 + 44847f9 commit 8db482e

File tree

5 files changed

+117
-93
lines changed

5 files changed

+117
-93
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ All states report whether there is a failure or not. `True` means a failure, `fa
185185

186186
### **WORK IN PROGRESS**
187187

188+
### 3.2.1 (2024-06-04) (Marching on)
189+
- (grizzelbee) Upd: Dependencies got updated
190+
- (grizzelbee) Upd: [#286](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/286) Fixed polling which got broken in v3.1.10
191+
192+
188193
### 3.2.0 (2024-05-28) (Marching on)
189194

190195
- (grizzelbee) Chg: Lamps (Product type 552a) won't generate a warning on startup any longer but show an info that they are not supported by this adapter.

io-package.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
{
22
"common": {
33
"name": "dysonairpurifier",
4-
"version": "3.2.0",
4+
"version": "3.2.1",
55
"news": {
6+
"3.2.1": {
7+
"en": "Fix: Fixed polling which got broken in v3.1.10\nChg: Dependencies got updated",
8+
"de": "Fix: Polling wurde korrigiert nachdem es in Version 3.1.10 kaputt gegangen ist.\nÄnderung: Abhängigkeiten wurden aktualisiert",
9+
"ru": "Исправлено: исправлен опрос, который был нарушен в версии 3.1.10\nChg: зависимости обновлены.",
10+
"pt": "Correção: Corrigida a pesquisa que foi interrompida na v3.1.10\nAlteração: As dependências foram atualizadas",
11+
"nl": "Fix: Vaste polling die kapot ging in v3.1.10\nChg: Afhankelijkheden zijn bijgewerkt",
12+
"fr": "Correctif : correction de l'interrogation qui était interrompue dans la v3.1.10\nChg : les dépendances ont été mises à jour",
13+
"it": "Correzione: risolto il polling che non funzionava nella versione 3.1.10\nChg: le dipendenze sono state aggiornate",
14+
"es": "Solución: Se corrigió el sondeo que se rompió en v3.1.10\nChg: Se actualizaron las dependencias",
15+
"pl": "Poprawka: Naprawiono odpytywanie, które uległo uszkodzeniu w wersji 3.1.10\nChg: Zaktualizowano zależności",
16+
"uk": "Виправлення: виправлено опитування, яке було порушено у версії 3.1.10\nChg: оновлено залежності",
17+
"zh-cn": "修复:修复了 v3.1.10 中损坏的轮询\nChg:依赖项已更新"
18+
},
619
"3.2.0": {
720
"en": "Chg: Lamps (Product type 552a) won't generate a warning on startup any longer but show an info that they are not supported by this adapter\nChg: Vacuum cleaner robots (Product types 276 and 277) won't generate a warning on startup any longer but show an info that they are not supported by this adapter\nNew: [#289](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/289) Added Support for Dyson Purifier Big+Quiet Formaldehyde (BP03, Produce type 664)\n Fix: [#287](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/287) Added Switzerland again to config\nUpd: Dependencies got updated\nChg: removed obsolete index_m\nFix: Fixed broken NO2Index\nFix: Fixed broken fan speeds 0-10\nFix: Fixed polling of sensor data\nFix: setting fan speed = Auto works\n",
821
"de": "Änderung: Lampen (Produkttyp 552a) generieren beim Start keine Warnung mehr, sondern zeigen einen Hinweis an, dass sie von diesem Adapter nicht unterstützt werden.\nÄnderung: Staubsaugerroboter (Produkttypen 276 und 277) generieren keine Warnung mehr Starten Sie nicht mehr, zeigen Sie jedoch die Information an, dass sie von diesem Adapter nicht unterstützt werden.\nNeu: [#289](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/289) Unterstützung für Dyson Purifier Big+Quiet Formaldehyde hinzugefügt (BP03, Produce-Typ 664)\n Fix: [#287](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/287) Schweiz erneut zur Konfiguration hinzugefügt\nAktualisiert: Abhängigkeiten wurden aktualisiert\nÄnderung: veralteter index_m entfernt \nFix: Fehlerhafter NO2Index behoben\nFix: Defekte Lüftergeschwindigkeiten 0-10 behoben\nFix: Abfrage von Sensordaten behoben\nFix: Einstellung der Lüftergeschwindigkeit = Auto funktioniert\n",

main.js

+21-9
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const {
4040
SPECIAL_PROPERTIES,
4141
getNameToDysoncodeTranslation
4242
} = require('./dysonConstants.js');
43+
const {setInterval} = require("node:timers/promises");
4344

4445
// Variable definitions
4546
// let adapter = null;
@@ -663,7 +664,7 @@ class dysonAirPurifier extends utils.Adapter {
663664
[
664665
'product-errors',
665666
'product-warnings',
666-
'module-warnings',
667+
'module-errors',
667668
'module-warnings'
668669
].includes(dysonCode)
669670
//row === 'product-errors' ||
@@ -1184,9 +1185,16 @@ class dysonAirPurifier extends utils.Adapter {
11841185
this.subscribeStates(`${device.Serial}.Sensor.PM25Index`);
11851186
}
11861187

1187-
async pollDeviceInfo(thisDevice, adapterLog) {
1188+
/**
1189+
*
1190+
* @param thisDevice {Object} link to the current Device object
1191+
* @param adapterLog {Object} link to the adapters log output
1192+
* @param reason {string} the reason why this function is called (for logging purposes)
1193+
* @returns {Promise<void>}
1194+
*/
1195+
async pollDeviceInfo(thisDevice, adapterLog, reason) {
11881196
adapterLog.debug(
1189-
`Updating device [${thisDevice.Serial}] (polling API scheduled).`
1197+
`Updating device [${thisDevice.Serial}] (polling API ${reason}).`
11901198
);
11911199
try {
11921200
// possible messages:
@@ -1285,7 +1293,7 @@ class dysonAirPurifier extends utils.Adapter {
12851293
function () {}
12861294
);
12871295
// Sends an initial request for current state of device
1288-
await adapter.pollDeviceInfo(thisDevice, adapterLog);
1296+
await adapter.pollDeviceInfo(thisDevice, adapterLog, 'initially');
12891297
// expect the adapter 20 seconds after first poll as Set-up
12901298
setTimeout(()=>{
12911299
adapterIsSetUp = true;
@@ -1311,11 +1319,15 @@ class dysonAirPurifier extends utils.Adapter {
13111319
`Starting Polltimer with a ${adapter.config.pollInterval} seconds interval.`
13121320
);
13131321
// start refresh scheduler with interval from adapters config
1314-
thisDevice.updateIntervalHandle = setTimeout( async () => {
1315-
await adapter.pollDeviceInfo(thisDevice, adapterLog);
1316-
},
1317-
adapter.config.pollInterval * 1000
1318-
);
1322+
if (adapter.config.pollInterval > 0) {
1323+
thisDevice.updateIntervalHandle = setTimeout(function schedule(){
1324+
adapter.pollDeviceInfo(thisDevice, adapterLog, '@ regular schedule');
1325+
thisDevice.updateIntervalHandle = setTimeout(schedule, adapter.config.pollInterval * 1000);
1326+
}, adapter.config.pollInterval * 1000);
1327+
1328+
} else {
1329+
adapterLog.info(`Disabled scheduled polling for device ${thisDevice.Serial}`);
1330+
}
13191331
});
13201332
/****************
13211333
* Message

package-lock.json

+68-74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)