Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Draes committed May 8, 2023
1 parent 36243cd commit 50922dd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Station does not answer to scheduler commands, so only listener mode is supporte

Latest version

#### 0.10.3 Bugfixes

#### 0.10.2 Bugfixes

#### 0.10.0 Added new sensors for Lightning, Piezo elements, DP250 and minor fixes
Expand Down
6 changes: 5 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"common": {
"name": "sainlogic",
"version": "0.10.2",
"version": "0.10.3",
"news": {
"0.10.3": {
"en": "Bugfixes last listener update at Ecowitt and forwarder",
"de": "Fehlerbehebungen last listener update und forwarder bei Ecowitt"
},
"0.10.2": {
"en": "Bugfixes and new datapoints of battery level of some sensors",
"de": "Fehlerbehebungen und neue Datenpunkte für Batterieslevels von ein paar Sensoren"
Expand Down
9 changes: 5 additions & 4 deletions lib/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,22 @@ class Listener {
request.on('end', () => {
this.adapter.log.debug('Listener body is ' + my_body);
json_response = parse(my_body);
this.adapter.setStates(new Date(), this.extract_values(json_response));
this.adapter.log.debug('Listener received EW update: ' + JSON.stringify(json_response));
json_response.last_listener_update = JSON.stringify(json_response);
//this.adapter.setStateAsync('info.last_listener_update', { val: JSON.stringify(json_response), ack: true });
response.end('ok');
this.adapter.setStates(new Date(), this.extract_values(json_response));

});


if (this.forward_url != null && this.forward_url != '') {
// forward to another host
const fwd_url = new URL(this.forward_url);

got(fwd_url, { method: 'POST', retry: 0, body: my_body }).then(response => {
this.adapter.log.info(response.body.url);
this.adapter.log.info(response.body.explanation);
got(fwd_url, { method: 'POST', retry: {limit: 0} , body: my_body }).then(got_response => {
this.adapter.log.info(got_response.body.url);
this.adapter.log.info(got_response.body.explanation);
}).catch(error => {
this.adapter.log.info(error);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.sainlogic",
"version": "0.10.2",
"version": "0.10.3",
"description": "Read data from a sainlogic based weather station",
"author": {
"name": "Daniel Draes",
Expand Down

0 comments on commit 50922dd

Please sign in to comment.