Skip to content

Commit

Permalink
Simplify logic for jsonata
Browse files Browse the repository at this point in the history
  • Loading branch information
dxdc committed Feb 14, 2020
1 parent 4aa2d2f commit 9bd1133
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ function BlindsHTTPAccessory(log, config) {
this.upURL = config.up_url || false;
this.downURL = config.down_url || false;
this.positionURL = config.position_url || false;
this.positionJsonata = false;
if (config.position_jsonata) {
try {
this.positionJsonata = jsonata(config.position_jsonata);
} catch (err) {
this.log.error(`Error parsing jsonata: ${err.message}`);
this.positionJsonata = false;
}
} else {
this.positionJsonata = false;
}

this.stopURL = config.stop_url || false;
Expand Down

0 comments on commit 9bd1133

Please sign in to comment.