Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanCording committed Jan 11, 2018
1 parent 7848061 commit de489ef
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 1 deletion.
6 changes: 6 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



NOTE: Be aware that the javascript-state-machine library has a non-commercial
LGPL-3.0 licence and requires a commercial licence to be used in commercial
applications.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# node-red-contrib-state-machine
A Node Red node that wraps around Javascript State Machine
A Node Red node that wraps around the [Javascript State Machine](https://www.npmjs.com/package/javascript-state-machine) to implement a [finite state machine](https://en.wikipedia.org/wiki/Finite-state_machine) for Node Red.

The node is configured with a number of states and triggers that will cause the node to transition from one
state to another. At any time, the node can only be in one of the defined states and it will only transition
to another state when it receives a trigger defined for the current state. The same trigger can be used to
cause transitions from more than one state. Triggers that are not valid for the current state are ignored.
The node will always start in the first state on the state list and will emit a message with the initial
state if the state output is set to a message property.

Global and flow context properties can be used as trigger inputs but state transitions will only occur when the node receives a message.

The current state can be set to a msg property or stored as a flow or global context property. If the state
output is set to a msg property, that property is set in the original message and passed through, otherwise
no messages are output.

13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "node-red-contrib-state-machine",
"version": "1.0.0",
"description": "A Node Red node for implementing a finite state machine.",
"dependencies": {
"javascript-state-machine": "3.*"
},
"author": {
"name": "Dean Cording",
"email": "[email protected]"
},
"license": "MIT",
"keywords": [
"node-red",
"iot",
"state machine",
"finite state machine",
"state",
"transition"
],
"bugs": {
"url": "https://github.com/DeanCording/node-red-contrib-state-machine/issues"
},
"homepage": "https://github.com/DeanCording/node-red-contrib-state-machine",
"repository": {
"type": "git",
"url": "https://github.com/DeanCording/node-red-contrib-state-machine.git"
},
"node-red": {
"nodes": {
"state-machine": "state-machine.js"
}
}
}
Loading

0 comments on commit de489ef

Please sign in to comment.