Skip to content

Latest commit

 

History

History
83 lines (54 loc) · 1.88 KB

DEVELOPERS.md

File metadata and controls

83 lines (54 loc) · 1.88 KB

Node-RED for PAC Control

Source Code

The code is written in TypeScript and then transpiled into JavaScript. For more information on creating Node-RED nodes, see the official Creating Nodes Overview.

The following instructions assume that development is done on a modern Linux system.

After cloning the Git repository, all further instructions assume that you are in the root of the source directory, which is likely called node-red-contrib-pac.

Install Dependencies

After cloning the repository to your computer, you need to install the dependencies by running:

npm install

Also, grunt-cli must be installed:

sudo npm install -g grunt-cli

Build

To build the JavaScript files from the TypeScript source, run:

grunt

You can also clean out all the output files with:

grunt clean

Link Nodes

In order for your development version of the PAC Control nodes to be used by Node-RED, you need to link your source directory into the local npm system. Run:

sudo npm link

Tests

There are two types of tests you can run: with or without a physical controller.

Internal Tests Without a Device

To run just the internal unit tests without a device, run:

grunt test-internal

All Tests

Running all tests requires the following:

  1. An EPIC or SNAP PAC controller with:
    1. (SNAP PAC only) 9.5 or greater firmware.
    2. REST API configured for HTTP or HTTPS access, and at least one API key.
    3. Running the PAC Control Basic strategy named NodeRedTester, which is located in the test/pac folder.
  2. A local copy of the settings.json file.
    1. From within ts/test/exernal, copy settings.json.tmpl to settings.json.
    2. Adjust the file to use your device's address and API key.

To run all the tests, run:

grunt test-all