Gathering detailed insights and metrics for node-red-contrib-toggle
Gathering detailed insights and metrics for node-red-contrib-toggle
Gathering detailed insights and metrics for node-red-contrib-toggle
Gathering detailed insights and metrics for node-red-contrib-toggle
npm install node-red-contrib-toggle
Typescript
Module System
Node Version
NPM Version
67.7
Supply Chain
98.6
Quality
75.5
Maintenance
100
Vulnerability
100
License
HTML (69.34%)
JavaScript (30.66%)
Total Downloads
41,895
Last Day
46
Last Week
338
Last Month
1,133
Last Year
15,711
2 Stars
12 Commits
2 Forks
2 Watching
1 Branches
2 Contributors
Latest Version
0.1.1
Package Id
node-red-contrib-toggle@0.1.1
Unpacked Size
101.50 kB
Size
85.25 kB
File Count
13
NPM Version
6.14.4
Node Version
12.18.0
Cumulative downloads
Total Downloads
Last day
-22%
46
Compared to previous day
Last week
61%
338
Compared to previous week
Last month
-31.7%
1,133
Compared to previous month
Last year
78.1%
15,711
Compared to previous year
Toggle switch node for Node-red.
This node is a companion for any switch (physical or virtual), storing its state and providing toggle operation without need of using function nodes or flow/global variables.
Fig. 1: Node appearance
~/.node-red
npm install node-red-contrib-toggle
The node configuration sets the active on/off/toggle keywords as well as optional topic names.
Fig. 2: Node properties
These attributes can be of type
They are set to the values you want to be the keywords within msg.payload
when the actions switch to ON, switch to OFF and toggle shall take place (execution command).
Remark: If you do not set a value to one of the attributes the according method (e.g. switch ON) can not be executed by the node (it needs a value to compare...).
If you set the topic attributes to a value, the input msg
needs to contain the same topic name to execute On/Off resp. toggle in addition to the msg.payload
value containing the execution command.
The node has three pass through modes:
msg
only when state is toggled. ON/OFF input messages just update internal state of the node.msg
for ON/OFF input message only once it differs from the previous state. And obviously message is always sent for "toggle" message.msg
is always sent as a reaction on an input msg
.The input msg.payload
contains the execution command to the node.
The value needs to be identical to the values you configured in the configuration dialog.
If a (string) value is set to the configuration attributes On/Off topic or Toggle topic, the msg.topic
property must contain the same string value to execute the command given in msg.payload
.
An example msg
contents is shown for On/Off topic = "onofftopic":
Fig. 3: Example msg
when using topics
The input msg
is forwarded to the output, if a valid switch command was detected.
The configuration attribute pass through ON/OFF messages is taken into account.
The node status signals:
Initially it shows no state.
Remark: Example flows are present in the examples subdirectory. In Node-RED they can be imported via the import function and then selecting Examples in the vertical tab menue.
This example shows the basic usage of the on and off commands.
The configuration is set to boolean true
resp. false
to switch on resp. switch off and no toggle option.
BasicUsage.json
Fig. 4: Basic usage example
This example shows the basic usage of the toggle command.
The configuration is set to boolean true
resp. false
and to toggle with all other msg.payload
/msg.topic
combinations.
ToggleUsage.json
Fig. 5: Toggle usage example
This example shows the usage of topics.
The configuration is set to strings (switchON
, switchOFF
) to switch on resp. off and a string (toggleSTATE
) to toggle the switch.
Additionally, the topics are set to onofftopic
(for the commands switchON
and switchOFF
) and to toggletopic
for the toggle operation (command toggleSTATE
).
TopicUsage.json
Fig. 6: Topic usage example
v0.1.1 Toggle example added to docu
v0.1.0 Docu rework
v0.0.2 Docs updated
v0.0.1 Initial release
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 2/5 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More