Skip to content

Commit

Permalink
Merge pull request #111 from tagyoureit/5.3-DEV
Browse files Browse the repository at this point in the history
5.3 dev
  • Loading branch information
tagyoureit authored Jan 4, 2019
2 parents 96688f3 + 446f5e3 commit f41b17d
Show file tree
Hide file tree
Showing 26 changed files with 648 additions and 363 deletions.
23 changes: 16 additions & 7 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,23 @@ ignore:
'npm:bootstrap:20160627':
- bootstrap:
reason: None given
expires: '2018-10-05T03:45:41.397Z'
expires: '2018-12-26T15:26:16.181Z'
'npm:lodash:20180130':
- snyk-go-plugin > graphlib > lodash:
reason: None given
expires: '2018-05-27T15:05:54.491Z'
request-promise > request-promise-core > lodash:
node-ssdp > async > lodash:
reason: None given
expires: '2018-11-13T23:00:17.087Z'
expires: '2019-02-03T00:16:15.673Z'
- node-ssdp > async > lodash:
reason: None given
expires: '2018-04-01T03:18:10.568Z'
expires: '2018-12-26T15:26:16.181Z'
request-promise > request-promise-core > lodash:
reason: None given
expires: '2019-02-03T00:16:15.674Z'
- request-promise > request-promise-core > lodash:
reason: None given
expires: '2018-04-01T03:18:10.569Z'
expires: '2018-12-26T15:26:16.181Z'
- node-ip > node-localip > wmic > async > lodash:
reason: None given
expires: '2018-04-01T03:18:10.568Z'
Expand All @@ -150,6 +153,12 @@ ignore:
- request-promise > request-promise-core > lodash:
reason: None given
expires: '2018-08-16T06:24:46.574Z'
- request-promise > request-promise-core > lodash:
reason: None given
expires: '2018-11-13T23:00:17.087Z'
- node-ip > node-localip > wmic > async > lodash:
reason: None given
expires: '2019-01-28T22:22:52.646Z'
'npm:hoek:20180212':
- request > hawk > hoek:
reason: None given
Expand All @@ -173,7 +182,7 @@ ignore:
'npm:extend:20180424':
- node-ssdp > extend:
reason: None given
expires: '2018-11-13T23:00:17.087Z'
expires: '2019-01-28T22:22:52.645Z'
- request > extend:
reason: None given
expires: '2018-08-23T22:44:40.819Z'
Expand All @@ -199,7 +208,7 @@ ignore:
'npm:chownr:20180731':
- serialport > prebuild-install > tar-fs > chownr:
reason: None given
expires: '2018-10-05T03:45:29.603Z'
expires: '2019-01-28T22:18:22.043Z'
- chokidar > fsevents > node-pre-gyp > tar > chownr:
reason: None given
expires: '2018-09-01T14:44:44.769Z'
Expand Down
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@

# nodejs-poolController - Version 5.2.0

# nodejs-poolController - Version 5.3.0



[![Join the chat at https://gitter.im/nodejs-poolController/Lobby](https://badges.gitter.im/nodejs-poolController/Lobby.svg)](https://gitter.im/nodejs-poolController/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/tagyoureit/nodejs-poolController.svg?branch=master)](https://travis-ci.org/tagyoureit/nodejs-poolController) [![Coverage Status](https://coveralls.io/repos/github/tagyoureit/nodejs-poolController/badge.svg?branch=master)](https://coveralls.io/github/tagyoureit/nodejs-poolController?branch=master) [![Known Vulnerabilities](https://snyk.io/test/github/tagyoureit/nodejs-poolcontroller/badge.svg)](https://snyk.io/test/github/tagyoureit/nodejs-poolcontroller)

[Full Changelog](#module_nodejs-poolController--changelog)

### 5.2.0
1. Node 6+ is supported. This app no longer supports Node 4.
1. Update of modules. Make sure to run `npm i` or `npm upgrade` to get the latest.
1. Much better support of multiple Intellibrite controllers. We can read both controllers now. There are still some issues with sending changes and help is needed to debug these.
1. Chlorinator API calls (and UI) will now make changes through Intellitouch when available, or directly to the Intellichlor if it is standalone (aka using the virtual controller)
1. Decoupled serial port and processing of packets. Should help recovery upon packet errors.
1. Implementation of #89. Expansion boards are now (better) supported by setting variables in your config.json. See the [config.json](#module_nodejs-poolController--config) section below.
1. Fix for #95
1. Fix for #99
1. Fix for #100

### 5.3.0
1. Fix for #106
1. Fix for "Error 60" messages
1. Improved caching of files on browsers. Thanks @arrmo! Now files will be loaded once in the browser and kept in cache instead of reloaded each time.
1. Improved handling of sessions and graceful closing of the HTTP(s) servers.



# License
Expand Down Expand Up @@ -198,10 +197,14 @@ for discussions, designs, and clarifications, we recommend you join our [Gitter


#### Chlorinator and Intellichem

(Note: As of 5.3 the Chlorinator API's will route the commands either through the Intellitouch/Intellicom or directly to the chlorinator depending upon your setup)
| Direction | Socket | API | Description |
| --- | --- | --- | --- |
| To app | <code>setchlorinator(level)</code> | <code>/chlorinator/{level}</code>|sets the level of output for chlorinator (pool only)
| To app | <code>setchlorinator(poolLevel, spaLevel, superChlorinateHours)</code> | <code>/chlorinator/{level}/spa/{level}/superChlorinateHours/{hours}</code>|sets the level of output for chlorinator (spa/superchlorinate can be omitted)
| To app | | <code>/chlorinator/pool/{level}</code>|sets the pool output %
| To app | | <code>/chlorinator/spa/{level}</code>|sets the spa output %
| To app | | <code>/chlorinator/pool/{level}/spa/{level}</code>|sets the pool & spa output %
| To app | | <code>/chlorinator/superChlorinateHours/{hours}</code>|sets the hours for super chlorination
| To client | <code>chlorinator</code> | outputs an object with the chlorinator information
| To app | | <code>/chlorinator</code> | outputs an object with the chlorinator information
| To app | <code>intellichem</code> | <code>/intellichem</code> |outputs an object with the intellichem information
Expand Down Expand Up @@ -947,7 +950,16 @@ See the constants.js file and the sections:
1. Started to move some of the inter-communications to emitter events for better micro-services and shorter call stacks (easier debugging; loosely coupled code).
1. Changed some Influx tags/queries.


### 5.2.0
1. Node 6+ is supported. This app no longer supports Node 4.
1. Update of modules. Make sure to run `npm i` or `npm upgrade` to get the latest.
1. Much better support of multiple Intellibrite controllers. We can read both controllers now. There are still some issues with sending changes and help is needed to debug these.
1. Chlorinator API calls (and UI) will now make changes through Intellitouch when available, or directly to the Intellichlor if it is standalone (aka using the virtual controller)
1. Decoupled serial port and processing of packets. Should help recovery upon packet errors.
1. Implementation of #89. Expansion boards are now (better) supported by setting variables in your config.json. See the [config.json](#module_nodejs-poolController--config) section below.
1. Fix for #95
1. Fix for #99
1. Fix for #100



Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@
},
"homepage": "https://github.com/tagyoureit/nodejs-poolController#readme",
"dependencies": {
"bluebird": "^3.5.0",
"bootstrap": "^3.3.7",
"bluebird": "^3.5.3",
"bootstrap": "^3.4.0",
"bottlejs": "^1.7.1",
"dateformat": "^3.0.3",
"deep-diff": "^1.0.1",
"dequeue": "^1.0.5",
"events": "^3.0.0",
"express": "^4.16.3",
"express": "^4.16.4",
"getmac": "^1.4.3",
"http-auth": "^3.1.3",
"http-shutdown": "^1.2.0",
"influx": "^5.0.7",
"ip": "^1.1.5",
"jquery": "^3.2.1",
Expand All @@ -65,24 +66,24 @@
"request": "^2.87.0",
"request-promise": "^4.2.2",
"serialport": "^6.2.2",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"underscore": "^1.9.1",
"winston": "^2.4.3",
"winston-transport": "^4.2.0",
"winston-transport": "^4.3.0",
"yargs-parser": "^10.1.0"
},
"devDependencies": {
"chai": "^4.0.1",
"coveralls": "^3.0.1",
"chai": "^4.2.0",
"coveralls": "^3.0.2",
"grunt": "^1.0.3",
"grunt-banner": "^0.6.0",
"istanbul": "^0.4.5",
"jshint": "^2.9.4",
"jshint": "^2.9.7",
"mocha": "^5.2.0",
"nock": "^9.3.3",
"sinon": "^6.1.4",
"snyk": "^1.83.0"
"snyk": "^1.120.1"
},
"snyk": true
}
24 changes: 12 additions & 12 deletions specs/assets/config/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"version": "5.2.0",
"meta": {
"notifications": {
"version": {
"remote": {
"version": "4.1.200",
"tag_name": "v4.1.200",
"dismissUntilNextRemoteVersionBump": false
}
}
}
},
"version": "5.3.0",
"equipment": {
"controller": {
"intellicom": {
Expand Down Expand Up @@ -141,16 +152,5 @@
}
}
},
"meta": {
"notifications": {
"version": {
"remote": {
"version": "4.0.0",
"tag_name": "v4.0.0",
"dismissUntilNextRemoteVersionBump": false
}
}
}
},
"integrations": {}
}
4 changes: 2 additions & 2 deletions specs/assets/replays/1/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.2.0",
"version": "5.3.01",
"equipment": {
"controller": {
"intellicom": {
Expand Down Expand Up @@ -292,4 +292,4 @@
"integrations": {
"outputToNodeRED": 1
}
}
}
2 changes: 1 addition & 1 deletion specs/assets/replays/1/packetCapture.json
Original file line number Diff line number Diff line change
Expand Up @@ -606,4 +606,4 @@
{"type":"packet","packet":[255,255,255,255,255,255,255,255,0,255,165,1,15,16,2,29,15,10,2,0,0,0,0,0,0,4,64,0,0,0,26,26],"direction":"inbound","level":"info","message":"","timestamp":"2018-08-01T19:11:22.818Z"}
{"type":"packet","packet":[0,0,27,0,0,0,0,4,0,0,0,1,3,1,154],"direction":"inbound","level":"info","message":"","timestamp":"2018-08-01T19:11:22.840Z"}
{"type":"packet","packet":[255,255,255,255,255,255,255,255,0,255,165,1,15,16,2,29,15,10,2,0,0,0,0,0,0,4,64,0,0,0,26,26],"direction":"inbound","level":"info","message":"","timestamp":"2018-08-01T19:11:24.774Z"}
{"type":"packet","packet":[0,0,27,0,0,0,0,4,0,0,0,1,3,1,154],"direction":"inbound","level":"info","message":"","timestamp":"2018-08-01T19:11:24.796Z"}
{"type":"packet","packet":[0,0,27,0,0,0,0,4,0,0,0,1,3,1,154],"direction":"inbound","level":"info","message":"","timestamp":"2018-08-01T19:11:24.796Z"}
18 changes: 9 additions & 9 deletions specs/assets/replays/1/packetCapture.log
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
15:09:47.871 INFO Settings:

*******************************
Version: 5.2.0
Version: 5.3.01

Configuration file name: config.json
*******************************{
"version": "5.2.0",
"version": "5.3.01",
"equipment": {
"controller": {
"intellicom": {
Expand Down Expand Up @@ -326,7 +326,7 @@ Configuration file name: config.json
15:09:47.974 SILLY New SOCKET.IO Client connected, rN_W8cd9yhLJ_2KjAAAA
15:09:47.975 SILLY Outputting socket all
15:09:47.975 SILLY Socket.IO checking if we need to output updateAvail: false (will send if false)
15:09:47.979 SILLY Socket.IO NOT outputting updateAvail because it is missing the result string: {"local":{"version":"5.2.0"}}
15:09:47.979 SILLY Socket.IO NOT outputting updateAvail because it is missing the result string: {"local":{"version":"5.3.01"}}
15:09:47.987 SILLY New https server connection ::ffff:127.0.0.1
15:09:47.988 SILLY New https server connection ::ffff:127.0.0.1
15:09:48.000 VERBOSE Sending NR POST
Expand All @@ -343,12 +343,12 @@ Configuration file name: config.json
15:09:48.134 SILLY updateAvail.compareLocaltoSavedLocal: (current) published release (5.1.1) to cached/last published config.json version (5.1.1)
15:09:48.134 SILLY updateAvail: no change in current remote version compared to local cached config.json version of app
15:09:48.136 SILLY updateAvail: versions discovered:
{"local":{"version":"5.2.0"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"}}
15:09:48.137 SILLY updateAvail: local ver: 5.2.0 latest published release ver: 5.1.1
15:09:48.139 INFO You are running a newer release (5.2.0) than the published release (5.1.1)
{"local":{"version":"5.3.01"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"}}
15:09:48.137 SILLY updateAvail: local ver: 5.3.01 latest published release ver: 5.1.1
15:09:48.139 INFO You are running a newer release (5.3.01) than the published release (5.1.1)
15:09:48.140 SILLY Outputting socket updateAvailable
15:09:48.141 SILLY Socket.IO checking if we need to output updateAvail: false (will send if false)
15:09:48.141 SILLY Socket.IO outputting updateAvail: {"local":{"version":"5.2.0"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"},"result":"newer","resultStr":"You are running a newer release (5.2.0) than the published release (5.1.1)"}
15:09:48.141 SILLY Socket.IO outputting updateAvail: {"local":{"version":"5.3.01"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"},"result":"newer","resultStr":"You are running a newer release (5.3.01) than the published release (5.1.1)"}
15:09:48.142 SILLY updateAvail: finished successfully
15:09:48.163 VERBOSE ISY: Response from ISY: [object Object] <html>
<head></head>
Expand Down Expand Up @@ -1860,7 +1860,7 @@ Full queue: [[255,0,255,165,1,16,33,232,1,0,1,192],
[255,0,255,165,1,16,33,219,1,1,1,180]]
15:09:49.849 SILLY Outputting socket all
15:09:49.849 SILLY Socket.IO checking if we need to output updateAvail: false (will send if false)
15:09:49.850 SILLY Socket.IO outputting updateAvail: {"local":{"version":"5.2.0"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"},"result":"newer","resultStr":"You are running a newer release (5.2.0) than the published release (5.1.1)"}
15:09:49.850 SILLY Socket.IO outputting updateAvail: {"local":{"version":"5.3.01"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"},"result":"newer","resultStr":"You are running a newer release (5.3.01) than the published release (5.1.1)"}
15:09:49.851 DEBUG postWritePacketHelper: First time writing packet.
{"counter":1,"packetWrittenAt":5,"msgWrote":[255,0,255,165,1,16,33,232,1,0,1,192]}
15:09:49.851 DEBUG writePacketHelper: Setting timeout to write next packet (will call preWritePacketHelper())
Expand Down Expand Up @@ -25698,7 +25698,7 @@ container.packetBuffer.length()(0) === 0 && bufferToProcess.length(0) > 0: false
15:10:49.881 SILLY New http server connection ::ffff:192.168.1.12
15:10:49.885 SILLY Outputting socket all
15:10:49.885 SILLY Socket.IO checking if we need to output updateAvail: false (will send if false)
15:10:49.897 SILLY Socket.IO outputting updateAvail: {"local":{"version":"5.2.0"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"},"result":"newer","resultStr":"You are running a newer release (5.2.0) than the published release (5.1.1)"}
15:10:49.897 SILLY Socket.IO outputting updateAvail: {"local":{"version":"5.3.01"},"remote":{"tag_name":"v5.1.1","version":"5.1.1"},"result":"newer","resultStr":"You are running a newer release (5.3.01) than the published release (5.1.1)"}
15:10:49.902 DEBUG NR Socket: Will not send circuit2status because the value has not changed (1)
15:10:49.902 DEBUG NR Socket: Will not send circuit3status because the value has not changed (0)
15:10:49.902 DEBUG NR Socket: Will not send circuit4status because the value has not changed (0)
Expand Down
15 changes: 13 additions & 2 deletions specs/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ describe('nodejs-poolController', function () {
describe('Loads/checks for a valid configuration file', function () {

before(function () {

// initialize winston once with defaults
return Promise.resolve()
.then(function(){
bottle.container.logger.init()
})
.delay(50)
.then(function(){
console.log("done")
bottle.container.logger.info("test logger")
bottle.container.logger.warn("test warn")
bottle.container.logger.error("test error")
})
})


beforeEach(function () {

updateAvailStub = sinon.stub(bottle.container.updateAvailable, 'getResultsAsync').returns(Promise.resolve({}))
if (global.logInitAndStop) {
loggerInfoStub = sinon.spy(bottle.container.logger, 'info')
Expand Down
4 changes: 2 additions & 2 deletions specs/lib/comms/controllers/chlorinator-controller.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe('chlorinator controller', function () {
describe('chlorinator controller - Virtual', function () {

describe('#startChlorinatorController starts the timer for 1 or 2 chlorinators', function () {

before(function () {
return global.initAllAsync({'configLocation': '/specs/assets/config/templates/config_intellichlor.json'})
return global.initAllAsync({'configLocation': '/specs/assets/config/templates/config_intellichlor_virtual.json'})
});

beforeEach(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('chlorinator packets: receives packets from buffer and follows them to
});
beforeEach(function () {
return global.initAllAsync({'configLocation': '/specs/assets/config/templates/config_intellichlor.json'})
return global.initAllAsync({'configLocation': '/specs/assets/config/templates/config_intellichlor_virtual.json'})
.then(function () {
sinon = sinon.sinon.create()
loggers = setupLoggerStubOrSpy('stub', 'spy')
Expand Down
Loading

0 comments on commit f41b17d

Please sign in to comment.