Skip to content

Commit

Permalink
Merge pull request #173 from phifogg/dev
Browse files Browse the repository at this point in the history
Update to 0.10.5
  • Loading branch information
phifogg committed Jul 23, 2023
2 parents 0ea7765 + 9d117ff commit efae4de
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ Station does not answer to scheduler commands, so only listener mode is supporte

Latest version

#### 0.10.5 Bugfix for state initialization, removed log messages for forwarding

#### 0.10.4 Bugfix for lightning count, new battery states for additional sensors

#### 0.10.3 Bugfixes

#### 0.10.2 Bugfixes
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.4",
"version": "0.10.5",
"news": {
"0.10.5": {
"en": "Bugfix for state initialization, removed log messages for forwarding",
"de": "Fehlerbehebung für Initialisierung der States, Log für Forwarding auf Debug umgestellt"
},
"0.10.4": {
"en": "Bugfix for lightning count, new battery states for additional sensors",
"de": "Fehlerbehebung für Lightning Count, neue Batterie-Datenpunkte für weitere Sensoren"
Expand Down
4 changes: 2 additions & 2 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ const DATAFIELDS = [
id: 'tf_batt',
channels: [{
channel: 'weather.info',
name: 'External sensor battery'
name: 'External sensor battery (TF)'
}],
type: 'number',
unit: 'V',
Expand All @@ -1295,7 +1295,7 @@ const DATAFIELDS = [
id: 'batt1',
channels: [{
channel: 'weather.info',
name: 'External sensor battery'
name: 'External sensor battery (Batt1)'
}],
type: 'number',
unit: 'V',
Expand Down
8 changes: 4 additions & 4 deletions lib/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class Listener {
const fwd_url = new URL(this.forward_url);

got(fwd_url, { searchParams: json_response, method: 'GET', retry: {limit: 0} }).then(got_response => {
this.adapter.log.info('Forward URL: + ' + got_response.requestUrl);
this.adapter.log.info('Forward response body: ' + got_response.body);
this.adapter.log.debug('Forward URL: + ' + got_response.requestUrl);
this.adapter.log.debug('Forward response body: ' + got_response.body);
}).catch(error => {
this.adapter.log.info(error);
});
Expand Down Expand Up @@ -114,8 +114,8 @@ class Listener {
const fwd_url = new URL(this.forward_url);

got(fwd_url, { method: 'POST', retry: {limit: 0} , body: my_body }).then(got_response => {
this.adapter.log.info('Forward URL: + ' + got_response.requestUrl);
this.adapter.log.info('Forward response body: ' + got_response.body);
this.adapter.log.debug('Forward URL: + ' + got_response.requestUrl);
this.adapter.log.debug('Forward response body: ' + got_response.body);
}).catch(error => {
this.adapter.log.info(error);
});
Expand Down
12 changes: 7 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ class Sainlogic extends utils.Adapter {

// check target type and type-cast if needed
let val_obj = { val: '', ack: true };
if (value != null) {
if (attrdef.type == 'number') {

if (attrdef.type == 'number'){
if (value != null) {
value = parseFloat(value);
} else {
value = 0;
}

val_obj = { val: value, ack: true };
}

this.getObject(obj_id, function (err, obj) {
if (err || obj == null) {

Expand Down Expand Up @@ -180,7 +182,7 @@ class Sainlogic extends utils.Adapter {
role: attrdef.role,
min: attrdef.min,
max: attrdef.max,
def: 0,
def: val_obj.val,
read: true,
write: false,
mobile: {
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.4",
"version": "0.10.5",
"description": "Read data from a sainlogic based weather station",
"author": {
"name": "Daniel Draes",
Expand Down

0 comments on commit efae4de

Please sign in to comment.