mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Fix timeswitch status to show time in timezone set in the properties
and bump library
This commit is contained in:
parent
8553dc30f2
commit
f7f313c197
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-timeswitch",
|
"name" : "node-red-node-timeswitch",
|
||||||
"version" : "0.2.2",
|
"version" : "1.0.0",
|
||||||
"description" : "A Node-RED node to provide a simple timeswitch to schedule daily on/off events.",
|
"description" : "A Node-RED node to provide a simple timeswitch to schedule daily on/off events.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"spacetime": "^6.16.3",
|
"spacetime": "^7.4.0",
|
||||||
"suncalc": "^1.8.0"
|
"suncalc": "^1.8.0"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
|
@ -123,17 +123,20 @@ module.exports = function (RED) {
|
|||||||
|
|
||||||
// handler function for the node payload, called below
|
// handler function for the node payload, called below
|
||||||
let sendPayload = (payload, nextTime) => {
|
let sendPayload = (payload, nextTime) => {
|
||||||
|
// var o = nextTime.goto(selectedTimeZone.name).offset()/60;
|
||||||
|
// if (o > 0) { o = "+" + o; }
|
||||||
|
// else {o = "-" + o; }
|
||||||
if (payload == 1) {
|
if (payload == 1) {
|
||||||
node.status({
|
node.status({
|
||||||
fill: "yellow",
|
fill: "yellow",
|
||||||
shape: "dot",
|
shape: "dot",
|
||||||
text: `on until ${nextTime.format("time")}`
|
text: `on until ${nextTime.goto(selectedTimeZone.name).format("time-24")}`
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
node.status({
|
node.status({
|
||||||
fill: "blue",
|
fill: "blue",
|
||||||
shape: "dot",
|
shape: "dot",
|
||||||
text: `off until ${nextTime.format("time")}`
|
text: `off until ${nextTime.goto(selectedTimeZone.name).format("time-24")}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var msg = {};
|
var msg = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user