Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
1.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Zefau authored Jul 4, 2020
1 parent 181c3fd commit 598ebe6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Connect your Philips Hue Lights with ioBroker.

## Changelog

### 1.3.8 (2020-07-04)
- (Zefau) fixed long-time polling for connection retry after connection fails serval times on short-time polling (see [#58](https://github.com/Zefau/ioBroker.hue-extended/issues/58))

### 1.3.7 (2020-07-01)
- (Zefau) added additional verification checks of the response received from the Hue Bridge (see [#45](https://github.com/Zefau/ioBroker.hue-extended/issues/45))
- (Zefau) fixed long-time polling for connection retry after connection fails serval times on short-time polling (see [#58](https://github.com/Zefau/ioBroker.hue-extended/issues/58))
Expand Down
14 changes: 10 additions & 4 deletions hue-extended.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ function startAdapter(options)
library.set(Library.CONNECTION, true);

// set current states from objects
for (let state in states)
for (let state in states) {
library.setDeviceState(state.replace(adapterName + '.' + adapter.instance + '.', ''), states[state] && states[state].val);
}

// retrieve payload from Hue Bridge
getPayload(adapter.config.refresh || 30);
Expand Down Expand Up @@ -633,6 +634,9 @@ function getPayload(refresh)
throw new Error('Incorrect data return from Hue API');
}

// everything looks good
library.set(Library.CONNECTION, true);

// create channel
library.set({
'node': channel,
Expand Down Expand Up @@ -702,6 +706,8 @@ function getPayload(refresh)
}

}).catch(err => {
library.set(Library.CONNECTION, false);

// Indicate that tree is not synchronized anymore
library.set({ ...library.getNode('syncing'), 'node': 'info.syncing' }, false);
//library.set({ ...library.getNode('syncing'), 'node': 'info.syncing' + library.ucFirst(channel) }, false);
Expand Down Expand Up @@ -733,13 +739,13 @@ function getPayload(refresh)
// TRY AGAIN OR STOP ADAPTER
let timeout = 60;
if (!retry || retry < 10) {
adapter.log.debug('Error connecting to Hue Bridge: ' + error + '. ' + (retry > 0 ? 'Already retried ' + retry + 'x so far. ' : '') + 'Try again in 10 seconds..');
adapter.log[!retry ? 'warn' : 'debug']('Error connecting to Hue Bridge: ' + error + '. ' + (retry > 0 ? 'Already retried ' + retry + 'x so far. ' : '') + 'Reconnecting..');
//adapter.log.debug(err.message);
//adapter.log.debug(JSON.stringify(err.stack));
timeout = 10;
timeout = 6;
}
else {
library.terminate('Error connecting to Hue Bridge: ' + error + '. ' + (retry > 0 ? 'Already retried ' + retry + 'x in total, thus connection closed now.' : 'Connection closed.') + ' See debug log for details.');
adapter.log.warn('Error connecting to Hue Bridge: ' + error + '. ' + (retry > 0 ? 'Already retried ' + retry + 'x so far. ' : '') + 'Try again in 1 minute..');
adapter.log.debug(err.message);
adapter.log.debug(JSON.stringify(err.stack));
}
Expand Down
4 changes: 2 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"common": {
"name": "hue-extended",
"version": "1.3.7",
"version": "1.3.8",
"title": "Philips Hue Extended",
"desc": {
"en": "Integration of all your Philips Hue Devices with your ioBroker",
Expand Down Expand Up @@ -109,7 +109,7 @@
"email": "[email protected]"
}
],
"installedFrom": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613"
"installedFrom": "iobroker.hue-extended@1.3.7"
},
"native": {
"refresh": 30,
Expand Down
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{
"_from": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613",
"_id": "[email protected].6",
"_from": "iobroker.hue-extended@1.3.7",
"_id": "[email protected].7",
"_inBundle": false,
"_integrity": "sha512-Oew4JpcBqB+T/RU+Dhn9fcCgwkvVtPTmtfkCA046A5BdlJ0fv3tvot/rdF+HxHIwtVaEwxFby/q+gFadNhnb9A==",
"_integrity": "sha512-6jDitHrsQpUkUM1FXBJjzazL3fM+fldJSr4QR9QKmytYrYcdZIXPdsLeN3osXiNThoUqZ5mHu1oaYnhQCRkOuA==",
"_location": "/iobroker.hue-extended",
"_phantomChildren": {},
"_requested": {
"type": "remote",
"raw": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613",
"rawSpec": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613",
"saveSpec": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613",
"fetchSpec": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613"
"type": "version",
"registry": true,
"raw": "[email protected]",
"name": "iobroker.hue-extended",
"escapedName": "iobroker.hue-extended",
"rawSpec": "1.3.7",
"saveSpec": null,
"fetchSpec": "1.3.7"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613",
"_shasum": "c2c8aebfc251946f2de05232cc0382f14edc41e0",
"_spec": "https://github.com/Zefau/ioBroker.hue-extended/tarball/4667185e9a4db67b24b2165e868301576d881613",
"_resolved": "https://registry.npmjs.org/iobroker.hue-extended/-/iobroker.hue-extended-1.3.7.tgz",
"_shasum": "5a095093f3c1f6ccce5b58c5d416011e1e755b74",
"_spec": "iobroker.hue-extended@1.3.7",
"_where": "/opt/iobroker",
"author": {
"name": "zefau",
Expand Down Expand Up @@ -73,5 +76,5 @@
"test:unit": "mocha test/unit --exit",
"translate": "gulp translateAndUpdateWordsJS"
},
"version": "1.3.7"
"version": "1.3.8"
}

0 comments on commit 598ebe6

Please sign in to comment.