Skip to content

Commit

Permalink
Fixed web extension
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Jan 31, 2024
1 parent e376bfa commit 7ab6164
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ iobroker add lametric
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**

* (klein0r) Fixed web extension

### 3.1.2 (2023-12-27)

* (klein0r) Updated LaMetric firmware version recommendation to 2.3.8 (3.0.21)
Expand Down
4 changes: 2 additions & 2 deletions lib/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class LaMetricWebExtension {
if (this.settings.secure) {
this.adapter.log.error(`Unable to register ${this.namespace} web extension - HTTPS is not supported by LaMetric`);
} else {
this.adapter.log.info(`${this.namespace} server listening on port http://${this.adapter.config.bind}:${this.settings.port}/${this.namespace}/`);

if (this.app && this.config.type === 'poll') {
this.app.use(this.appPath, (req, res) => {
this.adapter.log.debug(`Received ${req.method} request on ${req.url}`);
Expand All @@ -52,6 +50,8 @@ class LaMetricWebExtension {
res.status(500).send(JSON.stringify({ error: 'unsupported method' }));
}
});

this.adapter.log.info(`${this.namespace} server listening on port http://${this.adapter.config.bind}:${this.settings.port}/${this.namespace}/`);
}
}

Expand Down

0 comments on commit 7ab6164

Please sign in to comment.