From 04dbda9636ef21a4c047e499512a2cca595a366e Mon Sep 17 00:00:00 2001 From: Michael Rohrhirsch Date: Sat, 17 Jun 2023 17:55:07 +0200 Subject: [PATCH] change http to https --- nodes/forecast/weatherflow-forecast.js | 4 ++-- nodes/observations-device/observations-device.js | 4 ++-- nodes/observations-station/observations-station.js | 4 ++-- nodes/stations/weatherflow-stations.js | 8 +++----- package.json | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/nodes/forecast/weatherflow-forecast.js b/nodes/forecast/weatherflow-forecast.js index e143b5a..266f973 100644 --- a/nodes/forecast/weatherflow-forecast.js +++ b/nodes/forecast/weatherflow-forecast.js @@ -1,5 +1,5 @@ module.exports = function (RED) { - var http = require('http'); + var https = require('https'); function WeatherFlowNode(config) { RED.nodes.createNode(this, config); @@ -57,7 +57,7 @@ module.exports = function (RED) { } try { - http + https .request(options, callback) .on("error", (e) => { done('problem with request: ${e.message}'); diff --git a/nodes/observations-device/observations-device.js b/nodes/observations-device/observations-device.js index 55e03f5..b17c8b7 100644 --- a/nodes/observations-device/observations-device.js +++ b/nodes/observations-device/observations-device.js @@ -1,7 +1,7 @@ const { stat } = require('fs'); module.exports = function (RED) { - var http = require('http'); + var https = require('https'); function WeatherFlowNode(config) { RED.nodes.createNode(this, config); @@ -55,7 +55,7 @@ module.exports = function (RED) { } try { - http + https .request(options, callback) .on("error", (e) => { done('problem with request: ${e.message}'); diff --git a/nodes/observations-station/observations-station.js b/nodes/observations-station/observations-station.js index 6d3f352..8c567f6 100644 --- a/nodes/observations-station/observations-station.js +++ b/nodes/observations-station/observations-station.js @@ -1,7 +1,7 @@ const { stat } = require('fs'); module.exports = function (RED) { - var http = require('http'); + var https = require('https'); function WeatherFlowNode(config) { RED.nodes.createNode(this, config); @@ -47,7 +47,7 @@ module.exports = function (RED) { } try { - http + https .request(options, callback) .on("error", (e) => { done('problem with request: ${e.message}'); diff --git a/nodes/stations/weatherflow-stations.js b/nodes/stations/weatherflow-stations.js index eac2b03..c145c4e 100644 --- a/nodes/stations/weatherflow-stations.js +++ b/nodes/stations/weatherflow-stations.js @@ -1,5 +1,5 @@ module.exports = function (RED) { - var http = require('http'); + var https = require('https'); function WeatherFlowNode(config) { RED.nodes.createNode(this, config); @@ -8,8 +8,6 @@ module.exports = function (RED) { node.client = RED.nodes.getNode(config.client); node.on('input', function (msg, send, done) { - var input = this; - var options = { host: 'swd.weatherflow.com', path: '/swd/rest/stations?token=' + node.client.token @@ -33,7 +31,7 @@ module.exports = function (RED) { done(msg); } } catch (error) { - done(error); + done(error + '(' + str + ')'); } }); @@ -41,7 +39,7 @@ module.exports = function (RED) { try { - http + https .request(options, callback) .on("error", (e) => { done('problem with request: ${e.message}'); diff --git a/package.json b/package.json index d5095eb..7f21b2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-weatherflow-api-client", - "version": "1.2.3", + "version": "1.2.4", "author": "Michael Rohrhirsch (https://github.com/CrunkA3)", "description": "A WeahterFlow Tempest API client for Node-RED", "repository": {