node-red-contrib-scheduler-plus 1.1.0 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -0
- package/README.md +18 -5
- package/examples/basic-schedules.json +164 -0
- package/package.json +9 -6
- package/scheduler.html +4 -4
- package/scheduler.js +2 -2
package/LICENSE
ADDED
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Scheduler for Node-RED
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ltoinel/scheduler/actions/workflows/ci.yml)
|
|
4
|
-
[](https://github.com/ltoinel/node-red-contrib-scheduler-plus/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/ltoinel/node-red-contrib-scheduler-plus/actions/workflows/ci.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/node-red-contrib-scheduler-plus)
|
|
6
6
|
[](https://www.npmjs.com/package/node-red-contrib-scheduler-plus)
|
|
7
7
|
[](https://flows.nodered.org/node/node-red-contrib-scheduler-plus)
|
|
@@ -20,6 +20,8 @@ Originally written by Peter Scargill — see http://tech.scargill.net/node-red-s
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
+
The node is listed in the [Node-RED Flow Library](https://flows.nodered.org/node/node-red-contrib-scheduler-plus).
|
|
24
|
+
|
|
23
25
|
From the Node-RED palette manager, search for **node-red-contrib-scheduler-plus**, or from your
|
|
24
26
|
Node-RED user directory (usually `~/.node-red`):
|
|
25
27
|
|
|
@@ -63,7 +65,7 @@ dawn or dusk on that day (polar day or night at high latitudes).
|
|
|
63
65
|
## Development
|
|
64
66
|
|
|
65
67
|
```sh
|
|
66
|
-
git clone https://github.com/ltoinel/scheduler.git
|
|
68
|
+
git clone https://github.com/ltoinel/node-red-contrib-scheduler-plus.git
|
|
67
69
|
cd scheduler
|
|
68
70
|
npm install # also enables the git hooks
|
|
69
71
|
npm run lint # ESLint
|
|
@@ -80,10 +82,21 @@ Git hooks (in `.githooks/`, enabled by `npm install`):
|
|
|
80
82
|
|
|
81
83
|
1. Bump `version` in `package.json` and update the changelog.
|
|
82
84
|
2. Create a GitHub release with the tag `v<version>` (e.g. `v1.1.0`).
|
|
83
|
-
3. The [
|
|
85
|
+
3. The [Release](.github/workflows/release.yml) workflow lints, tests and publishes to npm with provenance.
|
|
84
86
|
|
|
85
87
|
## Changelog
|
|
86
88
|
|
|
89
|
+
### 1.1.3
|
|
90
|
+
- **Breaking change:** the node type is renamed from `scheduler` to `scheduler-plus`, so it no longer clashes with `node-red-contrib-scheduler` and `node-red-contrib-majordomus`. Existing flows show the old nodes as unknown: export the flow, replace `"type": "scheduler"` with `"type": "scheduler-plus"`, then import it again.
|
|
91
|
+
- Added a `LICENSE` file and the `license` field in `package.json` (same terms as before).
|
|
92
|
+
- Added an example flow, available in Node-RED under Import > Examples.
|
|
93
|
+
|
|
94
|
+
### 1.1.2
|
|
95
|
+
- Repository URLs updated to `ltoinel/node-red-contrib-scheduler-plus` (fixes npm provenance on publish).
|
|
96
|
+
|
|
97
|
+
### 1.1.1
|
|
98
|
+
- The npm publishing workflow is renamed to `release.yml`.
|
|
99
|
+
|
|
87
100
|
### 1.1.0
|
|
88
101
|
- Fixed wrong On Time values between 21:45 and 23:45 (offset by 10 minutes); existing flows are migrated automatically.
|
|
89
102
|
- Fixed a one-minute delay and negative values in the time computation.
|
|
@@ -101,5 +114,5 @@ Git hooks (in `.githooks/`, enabled by `npm install`):
|
|
|
101
114
|
|
|
102
115
|
## License
|
|
103
116
|
|
|
104
|
-
Free to use for whatever purpose you like. If you redesign it, please keep the original author's name and link
|
|
117
|
+
See [LICENSE](LICENSE). Free to use for whatever purpose you like. If you redesign it, please keep the original author's name and link
|
|
105
118
|
(http://tech.scargill.net).
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "c1",
|
|
4
|
+
"type": "comment",
|
|
5
|
+
"z": "",
|
|
6
|
+
"name": "Weekdays 07:00-08:00, and from dusk to 23:00 every day (Paris). Output 1 = on/off changes, output 2 = status every minute.",
|
|
7
|
+
"info": "",
|
|
8
|
+
"x": 400,
|
|
9
|
+
"y": 40,
|
|
10
|
+
"wires": []
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "s1",
|
|
14
|
+
"type": "scheduler-plus",
|
|
15
|
+
"z": "",
|
|
16
|
+
"name": "Weekday mornings",
|
|
17
|
+
"outtopic": "lights/morning",
|
|
18
|
+
"outpayload1": "on",
|
|
19
|
+
"outpayload2": "off",
|
|
20
|
+
"lat": "48.85",
|
|
21
|
+
"lon": "2.35",
|
|
22
|
+
"start": "sunrise",
|
|
23
|
+
"end": "sunset",
|
|
24
|
+
"starttime": "420",
|
|
25
|
+
"endtime": "480",
|
|
26
|
+
"duskoff": "0",
|
|
27
|
+
"dawnoff": "0",
|
|
28
|
+
"x": 180,
|
|
29
|
+
"y": 100,
|
|
30
|
+
"wires": [
|
|
31
|
+
[
|
|
32
|
+
"d1"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"d2"
|
|
36
|
+
]
|
|
37
|
+
],
|
|
38
|
+
"sun": false,
|
|
39
|
+
"mon": true,
|
|
40
|
+
"tue": true,
|
|
41
|
+
"wed": true,
|
|
42
|
+
"thu": true,
|
|
43
|
+
"fri": true,
|
|
44
|
+
"sat": false,
|
|
45
|
+
"jan": true,
|
|
46
|
+
"feb": true,
|
|
47
|
+
"mar": true,
|
|
48
|
+
"apr": true,
|
|
49
|
+
"may": true,
|
|
50
|
+
"jun": true,
|
|
51
|
+
"jul": true,
|
|
52
|
+
"aug": true,
|
|
53
|
+
"sep": true,
|
|
54
|
+
"oct": true,
|
|
55
|
+
"nov": true,
|
|
56
|
+
"dec": true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "s2",
|
|
60
|
+
"type": "scheduler-plus",
|
|
61
|
+
"z": "",
|
|
62
|
+
"name": "Dusk to 23:00",
|
|
63
|
+
"outtopic": "lights/evening",
|
|
64
|
+
"outpayload1": "on",
|
|
65
|
+
"outpayload2": "off",
|
|
66
|
+
"lat": "48.85",
|
|
67
|
+
"lon": "2.35",
|
|
68
|
+
"start": "sunrise",
|
|
69
|
+
"end": "sunset",
|
|
70
|
+
"starttime": "6000",
|
|
71
|
+
"endtime": "1380",
|
|
72
|
+
"duskoff": "0",
|
|
73
|
+
"dawnoff": "0",
|
|
74
|
+
"x": 180,
|
|
75
|
+
"y": 200,
|
|
76
|
+
"wires": [
|
|
77
|
+
[
|
|
78
|
+
"d3"
|
|
79
|
+
],
|
|
80
|
+
[
|
|
81
|
+
"d4"
|
|
82
|
+
]
|
|
83
|
+
],
|
|
84
|
+
"sun": true,
|
|
85
|
+
"mon": true,
|
|
86
|
+
"tue": true,
|
|
87
|
+
"wed": true,
|
|
88
|
+
"thu": true,
|
|
89
|
+
"fri": true,
|
|
90
|
+
"sat": true,
|
|
91
|
+
"jan": true,
|
|
92
|
+
"feb": true,
|
|
93
|
+
"mar": true,
|
|
94
|
+
"apr": true,
|
|
95
|
+
"may": true,
|
|
96
|
+
"jun": true,
|
|
97
|
+
"jul": true,
|
|
98
|
+
"aug": true,
|
|
99
|
+
"sep": true,
|
|
100
|
+
"oct": true,
|
|
101
|
+
"nov": true,
|
|
102
|
+
"dec": true
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "d1",
|
|
106
|
+
"type": "debug",
|
|
107
|
+
"z": "",
|
|
108
|
+
"name": "morning change",
|
|
109
|
+
"active": true,
|
|
110
|
+
"tosidebar": true,
|
|
111
|
+
"console": false,
|
|
112
|
+
"tostatus": false,
|
|
113
|
+
"complete": "true",
|
|
114
|
+
"targetType": "full",
|
|
115
|
+
"x": 450,
|
|
116
|
+
"y": 80,
|
|
117
|
+
"wires": []
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "d2",
|
|
121
|
+
"type": "debug",
|
|
122
|
+
"z": "",
|
|
123
|
+
"name": "morning status",
|
|
124
|
+
"active": true,
|
|
125
|
+
"tosidebar": true,
|
|
126
|
+
"console": false,
|
|
127
|
+
"tostatus": false,
|
|
128
|
+
"complete": "true",
|
|
129
|
+
"targetType": "full",
|
|
130
|
+
"x": 450,
|
|
131
|
+
"y": 120,
|
|
132
|
+
"wires": []
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"id": "d3",
|
|
136
|
+
"type": "debug",
|
|
137
|
+
"z": "",
|
|
138
|
+
"name": "evening change",
|
|
139
|
+
"active": true,
|
|
140
|
+
"tosidebar": true,
|
|
141
|
+
"console": false,
|
|
142
|
+
"tostatus": false,
|
|
143
|
+
"complete": "true",
|
|
144
|
+
"targetType": "full",
|
|
145
|
+
"x": 450,
|
|
146
|
+
"y": 180,
|
|
147
|
+
"wires": []
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "d4",
|
|
151
|
+
"type": "debug",
|
|
152
|
+
"z": "",
|
|
153
|
+
"name": "evening status",
|
|
154
|
+
"active": true,
|
|
155
|
+
"tosidebar": true,
|
|
156
|
+
"console": false,
|
|
157
|
+
"tostatus": false,
|
|
158
|
+
"complete": "true",
|
|
159
|
+
"targetType": "full",
|
|
160
|
+
"x": 450,
|
|
161
|
+
"y": 220,
|
|
162
|
+
"wires": []
|
|
163
|
+
}
|
|
164
|
+
]
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-scheduler-plus",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A Node Red Timer with dusk, dawn and months",
|
|
5
5
|
"author": "Peter Scargill <pete@scargill.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Ludovic Toinel"
|
|
8
8
|
],
|
|
9
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/ltoinel/scheduler.git"
|
|
12
|
+
"url": "git+https://github.com/ltoinel/node-red-contrib-scheduler-plus.git"
|
|
12
13
|
},
|
|
13
14
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/ltoinel/scheduler/issues"
|
|
15
|
+
"url": "https://github.com/ltoinel/node-red-contrib-scheduler-plus/issues"
|
|
15
16
|
},
|
|
16
|
-
"homepage": "https://github.com/ltoinel/scheduler#readme",
|
|
17
|
+
"homepage": "https://github.com/ltoinel/node-red-contrib-scheduler-plus#readme",
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"suncalc": "^2.1.1"
|
|
19
20
|
},
|
|
@@ -27,7 +28,9 @@
|
|
|
27
28
|
"files": [
|
|
28
29
|
"scheduler.js",
|
|
29
30
|
"scheduler.html",
|
|
30
|
-
"icons/"
|
|
31
|
+
"icons/",
|
|
32
|
+
"examples/",
|
|
33
|
+
"LICENSE"
|
|
31
34
|
],
|
|
32
35
|
"scripts": {
|
|
33
36
|
"lint": "eslint .",
|
|
@@ -41,7 +44,7 @@
|
|
|
41
44
|
"node-red": {
|
|
42
45
|
"version": ">=1.0.0",
|
|
43
46
|
"nodes": {
|
|
44
|
-
"scheduler": "scheduler.js"
|
|
47
|
+
"scheduler-plus": "scheduler.js"
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
package/scheduler.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
once every minute.
|
|
10
10
|
-->
|
|
11
11
|
|
|
12
|
-
<script type="text/html" data-template-name="scheduler">
|
|
12
|
+
<script type="text/html" data-template-name="scheduler-plus">
|
|
13
13
|
<div class="form-row">
|
|
14
14
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
15
15
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
</div>
|
|
98
98
|
</script>
|
|
99
99
|
|
|
100
|
-
<script type="text/html" data-help-name="scheduler">
|
|
100
|
+
<script type="text/html" data-help-name="scheduler-plus">
|
|
101
101
|
<p>Turns something on and off according to a schedule based on fixed times,
|
|
102
102
|
dawn/dusk (computed with the <code>suncalc</code> module), days of the week and months.
|
|
103
103
|
The schedule is evaluated every minute.</p>
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
[10001, 10002, 10005, 10010, 10015, 10030, 10060, 10090, 10120].indexOf(t) !== -1;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
RED.nodes.registerType("scheduler", {
|
|
166
|
+
RED.nodes.registerType("scheduler-plus", {
|
|
167
167
|
category: "input",
|
|
168
168
|
color: "#6699ff",
|
|
169
169
|
defaults: {
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
onclick: function () {
|
|
231
231
|
var label = this.name || "scheduler";
|
|
232
232
|
$.ajax({
|
|
233
|
-
url: "scheduler/" + this.id,
|
|
233
|
+
url: "scheduler-plus/" + this.id,
|
|
234
234
|
type: "POST",
|
|
235
235
|
success: function () {
|
|
236
236
|
RED.notify("Successfully injected: " + label, "success");
|
package/scheduler.js
CHANGED
|
@@ -168,9 +168,9 @@ module.exports = function (RED) {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
RED.nodes.registerType("scheduler", SchedulerNode);
|
|
171
|
+
RED.nodes.registerType("scheduler-plus", SchedulerNode);
|
|
172
172
|
|
|
173
|
-
RED.httpAdmin.post("/scheduler/:id", RED.auth.needsPermission("scheduler.write"), function (req, res) {
|
|
173
|
+
RED.httpAdmin.post("/scheduler-plus/:id", RED.auth.needsPermission("scheduler-plus.write"), function (req, res) {
|
|
174
174
|
var node = RED.nodes.getNode(req.params.id);
|
|
175
175
|
if (node === null || node === undefined) {
|
|
176
176
|
res.sendStatus(404);
|