Skip to content

Commit

Permalink
fix connection state
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Jan 28, 2024
1 parent 37647c8 commit d9eae6a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"common": {
"name": "bwt",
"version": "0.1.0",
"version": "0.1.1",
"news": {
"0.1.0": {
"0.1.1": {
"en": "add local api connection",
"de": "Lokale API Verbindung hinzugefügt"
},
Expand Down
2 changes: 2 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,13 @@ class Bwt extends utils.Adapter {
headers: headers,
})
.then((res) => {
this.setState('info.connection', true, true);
this.log.debug(JSON.stringify(res.data));
const data = res.data;
this.json2iob.parse('local.' + element.path, data, { forceIndex: true });
})
.catch((error) => {
this.setState('info.connection', false, true);
this.log.error(url);
this.log.error(error);
error.response && this.log.error(JSON.stringify(error.response.data));
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.bwt",
"version": "0.1.0",
"version": "0.1.1",
"description": "Adapter for bwt devices",
"author": {
"name": "TA2k",
Expand Down

0 comments on commit d9eae6a

Please sign in to comment.