Skip to content

Commit

Permalink
Merge pull request #299 from Grizzelbee/development
Browse files Browse the repository at this point in the history
v.3.2.2-beta-2
  • Loading branch information
Grizzelbee authored Jun 18, 2024
2 parents 4fd0ff4 + 2bbeaa8 commit b6ee9ef
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"upgrade": true,
"reject": ["chai", "eslint"]
"reject": ["chai", "eslint", "@eslint/js"]
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ All states report whether there is a failure or not. `True` means a failure, `fa

### **WORK IN PROGRESS**

### 3.2.2 (2024-06-18) (Marching on)
- (grizzelbee) Upd: Dependencies got updated
- (grizzelbee) Upd: [#286](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/286) Fixed polling which got broken in v3.1.10


### 3.2.1 (2024-06-04) (Marching on)
- (grizzelbee) Upd: Dependencies got updated
- (grizzelbee) Upd: [#286](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/286) Fixed polling which got broken in v3.1.10
Expand Down
1 change: 0 additions & 1 deletion dyson-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ module.exports.deleteUnusedFields = async function (self, device) {
for (const field of dysonConstants.FIELDSTODELETE) {
const id = device + field;
self.log.debug(`Looking for deprecated field: ${id}`);
// const self = this;
self.getObject(id, (err, oldObj) => {
if (!err && oldObj) {
self.log.info(`Deleting deprecated field: ${id}`);
Expand Down
15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "dysonairpurifier",
"version": "3.2.2-beta-1",
"version": "3.2.2-beta-2",
"news": {
"3.2.2": {
"en": "Fix: Fixed polling which got broken in v3.1.10\nChg: Dependencies got updated",
"de": "Fix: Polling wurde korrigiert nachdem es in Version 3.1.10 kaputt gegangen ist.\nÄnderung: Abhängigkeiten wurden aktualisiert",
"ru": "Исправлено: исправлен опрос, который был нарушен в версии 3.1.10\nChg: зависимости обновлены.",
"pt": "Correção: Corrigida a pesquisa que foi interrompida na v3.1.10\nAlteração: As dependências foram atualizadas",
"nl": "Fix: Vaste polling die kapot ging in v3.1.10\nChg: Afhankelijkheden zijn bijgewerkt",
"fr": "Correctif : correction de l'interrogation qui était interrompue dans la v3.1.10\nChg : les dépendances ont été mises à jour",
"it": "Correzione: risolto il polling che non funzionava nella versione 3.1.10\nChg: le dipendenze sono state aggiornate",
"es": "Solución: Se corrigió el sondeo que se rompió en v3.1.10\nChg: Se actualizaron las dependencias",
"pl": "Poprawka: Naprawiono odpytywanie, które uległo uszkodzeniu w wersji 3.1.10\nChg: Zaktualizowano zależności",
"uk": "Виправлення: виправлено опитування, яке було порушено у версії 3.1.10\nChg: оновлено залежності",
"zh-cn": "修复:修复了 v3.1.10 中损坏的轮询\nChg:依赖项已更新"
},
"3.2.1": {
"en": "Fix: Fixed polling which got broken in v3.1.10\nChg: Dependencies got updated",
"de": "Fix: Polling wurde korrigiert nachdem es in Version 3.1.10 kaputt gegangen ist.\nÄnderung: Abhängigkeiten wurden aktualisiert",
Expand Down
43 changes: 36 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const {
SPECIAL_PROPERTIES,
getNameToDysoncodeTranslation
} = require('./dysonConstants.js');
const {setInterval} = require("node:timers/promises");
const { setInterval } = require('node:timers');

// Variable definitions
// let adapter = null;
Expand Down Expand Up @@ -1290,7 +1290,13 @@ class dysonAirPurifier extends utils.Adapter {
// Subscribes to the status topic to receive updates
thisDevice.mqttClient.subscribe(
`${thisDevice.ProductType}/${thisDevice.Serial}/status/current`,
function () {}
function (err) {
if (!err) {
adapterLog.debug(`Subscribed to current state of device ${thisDevice.Serial}.`);
} else {
adapterLog.warn(`${thisDevice.Serial}: ${err}`);
}
}
);
// Sends an initial request for current state of device
await adapter.pollDeviceInfo(thisDevice, adapterLog, 'initially');
Expand All @@ -1302,29 +1308,52 @@ class dysonAirPurifier extends utils.Adapter {
// Subscribes to the "faults" topic to receive updates on any faults and warnings
thisDevice.mqttClient.subscribe(
`${thisDevice.ProductType}/${thisDevice.Serial}/status/faults`,
function () {}
function (err) {
if (!err) {
adapterLog.debug(`Subscribed to faults of device ${thisDevice.Serial}.`);
} else {
adapterLog.warn(`${thisDevice.Serial}: ${err}`);
}
}
);
// Subscribes to the software topic to receive updates on any faults and warnings
thisDevice.mqttClient.subscribe(
`${thisDevice.ProductType}/${thisDevice.Serial}/status/software`,
function () {}
function (err) {
if (!err) {
adapterLog.debug(`Subscribed to software state of device ${thisDevice.Serial}.`);
} else {
adapterLog.warn(`${thisDevice.Serial}: ${err}`);
}
}
);
// Subscribes to the connection topic to receive updates on any faults and warnings
thisDevice.mqttClient.subscribe(
`${thisDevice.ProductType}/${thisDevice.Serial}/status/connection`,
function () {}
);
function (err) {
if (!err) {
adapterLog.debug(`Subscribed to connection state of device ${thisDevice.Serial}.`);
} else {
adapterLog.warn(`${thisDevice.Serial}: ${err}`);
}
});
// Sets the interval for status updates
adapterLog.info(
`Starting Polltimer with a ${adapter.config.pollInterval} seconds interval.`
`Starting Polltimer with a ${adapter.config.pollInterval} seconds interval for device ${thisDevice.Serial}.`
);
// start refresh scheduler with interval from adapters config
if (adapter.config.pollInterval > 0) {
thisDevice.updateIntervalHandle = setInterval(()=> {
adapter.pollDeviceInfo(thisDevice, adapterLog, '@ regular schedule');
}, adapter.config.pollInterval * 1000);
/*
thisDevice.updateIntervalHandle = setTimeout(function schedule(){
adapter.pollDeviceInfo(thisDevice, adapterLog, '@ regular schedule');
thisDevice.updateIntervalHandle = setTimeout(schedule, adapter.config.pollInterval * 1000);
}, adapter.config.pollInterval * 1000);
*/

} else {
adapterLog.info(`Disabled scheduled polling for device ${thisDevice.Serial}`);
}
Expand Down
86 changes: 49 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.dysonairpurifier",
"version": "3.2.2-beta-1",
"version": "3.2.2-beta-2",
"description": "dyson air purifiers and fans",
"author": {
"name": "grizzelbee",
Expand Down Expand Up @@ -47,7 +47,7 @@
"readmeFilename": "README.md",
"snyk": true,
"dependencies": {
"@iobroker/adapter-core": "^3.1.5",
"@iobroker/adapter-core": "^3.1.6",
"@iobroker/plugin-sentry": "^2.0.4",
"@snyk/protect": "^1.1291.1",
"axios": "^1.7.2",
Expand All @@ -59,23 +59,23 @@
},
"devDependencies": {
"@alcalzone/release-script": "^3.7.0",
"@eslint/js": "^9.4.0",
"@eslint/js": "^8.57.0",
"@iobroker/adapter-dev": "^1.3.0",
"@iobroker/testing": "^4.1.3",
"@types/chai": "^4.3.16",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/node": "^20.14.1",
"@types/node": "^20.14.5",
"@types/proxyquire": "^1.3.31",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^3.2.12",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.2",
"chai-as-promised": "^8.0.0",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"mocha": "^10.4.0",
"prettier": "^3.3.0",
"prettier": "^3.3.2",
"prettier-plugin-organize-imports": "^3.2.4",
"proxyquire": "^2.1.3",
"sinon": "^18.0.0",
Expand Down

0 comments on commit b6ee9ef

Please sign in to comment.