Skip to content

Commit

Permalink
Merge pull request #8 from CrunkA3/7-example-flow-crashed-node-red-on…
Browse files Browse the repository at this point in the history
…-raspberry-pi-4

change http to https
  • Loading branch information
CrunkA3 authored Jun 17, 2023
2 parents f14e30c + 04dbda9 commit 5ac117a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nodes/forecast/weatherflow-forecast.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (RED) {
var http = require('http');
var https = require('https');

function WeatherFlowNode(config) {
RED.nodes.createNode(this, config);
Expand Down Expand Up @@ -57,7 +57,7 @@ module.exports = function (RED) {
}

try {
http
https
.request(options, callback)
.on("error", (e) => {
done('problem with request: ${e.message}');
Expand Down
4 changes: 2 additions & 2 deletions nodes/observations-device/observations-device.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -55,7 +55,7 @@ module.exports = function (RED) {
}

try {
http
https
.request(options, callback)
.on("error", (e) => {
done('problem with request: ${e.message}');
Expand Down
4 changes: 2 additions & 2 deletions nodes/observations-station/observations-station.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -47,7 +47,7 @@ module.exports = function (RED) {
}

try {
http
https
.request(options, callback)
.on("error", (e) => {
done('problem with request: ${e.message}');
Expand Down
8 changes: 3 additions & 5 deletions nodes/stations/weatherflow-stations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (RED) {
var http = require('http');
var https = require('https');

function WeatherFlowNode(config) {
RED.nodes.createNode(this, config);
Expand All @@ -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
Expand All @@ -33,15 +31,15 @@ module.exports = function (RED) {
done(msg);
}
} catch (error) {
done(error);
done(error + '(' + str + ')');
}

});
}

try {

http
https
.request(options, callback)
.on("error", (e) => {
done('problem with request: ${e.message}');
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": "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": {
Expand Down

0 comments on commit 5ac117a

Please sign in to comment.