Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tagyoureit committed Jun 2, 2018
1 parent 0b7af85 commit 9e870c2
Show file tree
Hide file tree
Showing 28 changed files with 2,646 additions and 961 deletions.
8 changes: 4 additions & 4 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,11 @@ ignore:
'npm:bootstrap:20160627':
- bootstrap:
reason: None given
expires: '2018-05-27T15:05:54.490Z'
expires: '2018-06-27T21:13:28.800Z'
'npm:lodash:20180130':
- snyk-go-plugin > graphlib > lodash:
reason: None given
expires: '2018-05-27T15:05:54.491Z'
node-ip > node-localip > wmic > async > lodash:
reason: None given
expires: '2018-06-03T00:32:11.116Z'
- node-ssdp > async > lodash:
reason: None given
expires: '2018-04-01T03:18:10.568Z'
Expand All @@ -141,6 +138,9 @@ ignore:
- request-promise > request-promise-core > lodash:
reason: None given
expires: '2018-06-03T00:31:50.876Z'
- node-ip > node-localip > wmic > async > lodash:
reason: None given
expires: '2018-06-03T00:32:11.116Z'
'npm:hoek:20180212':
- request > hawk > hoek:
reason: None given
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
1. Fixed bad characters in custom names


#### 5.1.0 Highlights
1. Intellibrite support - API's, Sockets and a WebUI
Will document more later... but...
/light/mode/:mode
/light/circuit/:circuit/setColor/:color
/light/circuit/:circuit/setSwimDelay/:delay
/light/circuit/:circuit/setPosition/:position

See the constants.js file and the sections:
strIntellibriteModes (for modes)
lightColors (for setColor)

#### 5.0.0 Highlights

Make sure to run `npm upgrade`. There are many package updates and changes.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodejs-poolcontroller",
"version": "5.0.1",
"version": "5.1.0",
"description": "NodeJS program to read and write to the the pool equipment serial bus.",
"main": "src/index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions specs/assets/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
}
},
"version": "5.0.0",
"version": "5.1.0",
"equipment": {
"controller": {
"intellicom": {
Expand Down Expand Up @@ -132,6 +132,7 @@
"logPumpTimers": 0,
"logReload": 0,
"logApi": 0,
"logIntellibrite": 0,
"fileLog": {
"enable": 0,
"fileLogLevel": "silly",
Expand All @@ -148,4 +149,4 @@
}
},
"integrations": {}
}
}
13 changes: 13 additions & 0 deletions specs/assets/config/templates/config_intellibrite.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"poolController": {

"log": {
"logLevel": "silly",
"logIntellibrite": 1,
"logMessageDecoding": 1,
"logPacketWrites": 1,
"logAPI": 1
},
"appAddress": 34
}
}
51 changes: 29 additions & 22 deletions specs/lib/comms/inbound/controller_packets/2.spec.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,72 @@
describe('processes 2 (Status) packets', function() {
describe('processes 2 (Status) packets', function () {
var data = [
Buffer.from([255, 0, 255, 165,33,15,16,2,29,12,41,32,0,0,0,0,0,0,0,3,0,64,4,60,60,0,0,62,71,0,0,0,0,0,74,142,0,13,3,130])
Buffer.from([255, 0, 255, 165, 33, 15, 16, 2, 29, 12, 41, 32, 0, 0, 0, 0, 0, 0, 0, 3, 0, 64, 4, 60, 60, 0, 0, 62, 71, 0, 0, 0, 0, 0, 74, 142, 0, 13, 3, 130])
]

var equip = 'controller'

describe('#When packets arrive', function() {
context('via serialport or Socat', function() {
describe('#When packets arrive', function () {
context('via serialport or Socat', function () {

before(function() {
before(function () {
return global.initAllAsync()
});

beforeEach(function() {
// sandbox = sinon.sandbox.create()
//clock = sandbox.useFakeTimers()
// queuePacketStub = sandbox.stub(bottle.container.queuePacket, 'queuePacket')
beforeEach(function () {
loggers = setupLoggerStubOrSpy('stub', 'spy')
// writeNetPacketStub = sandbox.stub(bottle.container.sp, 'writeNET')
// writeSPPacketStub = sandbox.stub(bottle.container.sp, 'writeSP')

bottle.container.circuit.init()
})

afterEach(function() {
afterEach(function () {
sandbox.restore()

})

after(function() {
after(function () {
return global.stopAllAsync()
})

it('#Processes a controller status packet', function(done) {
it('#Processes a controller status packet', function (done) {
Promise.resolve()
.then(function(){
.then(function () {
return bottle.container.packetBuffer.push(data[0])
})
.delay(50)
.then(
function(){
function () {
bottle.container.temperatures.getTemperatures().temperature.airTemp.should.equal(62)
bottle.container.time.getTime().time.controllerTime.should.equal('12:41 PM')
})
.then(done, done)
})

it('#Processes a Duplicate Broadcast controller status packet', function(done) {
it('#Processes a Duplicate Broadcast controller status packet', function (done) {
Promise.resolve()
.then(function(){
.then(function () {
return bottle.container.packetBuffer.push(data[0])
})
.then(function(){
.then(function () {
return bottle.container.packetBuffer.push(data[0])
})
.delay(50)
.then(
function(){
function () {
bottle.container.temperatures.getTemperatures().temperature.airTemp.should.equal(62)
bottle.container.time.getTime().time.controllerTime.should.equal('12:41 PM')
loggers.loggerVerboseStub.args[1][0].should.contain('Duplicate broadcast.')
var text = 'not found'
// iterate through debug statements to see if we find 'duplicate broadcast
loggers.loggerDebugStub.args.forEach(function (i) {
i.forEach(function (j) {
if (typeof j === 'string') {
if (j.includes('Duplicate broadcast')) {
text = 'found'
}
}
})
})
text.should.eq('found')
// loggers.loggerDebugStub.args[4][0].should.contain('Duplicate broadcast.')

})
.then(done, done)
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
describe('chlorinator packets: receives packets from buffer and follows them to decoding', function () {
Expand Down Expand Up @@ -260,3 +261,4 @@ describe('chlorinator packets: receives packets from buffer and follows them to
})
})
*/
2 changes: 1 addition & 1 deletion specs/lib/comms/server-api-misc.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('server', function() {
//clock = sandbox.useFakeTimers()
writeSPPacketStub = sandbox.stub(bottle.container.sp, 'writeSP')//.callsFake(function(){bottle.container.writePacket.postWritePacketHelper()})
sandbox.stub(bottle.container.intellitouch, 'getPreambleByte').returns(33)
queuePacketStub = sandbox.stub(bottle.container.queuePacket, 'queuePacket')
//queuePacketStub = sandbox.stub(bottle.container.queuePacket, 'queuePacket')

})

Expand Down
44 changes: 28 additions & 16 deletions specs/lib/equipment/circuit.spec.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
// var myModule = rewire(path.join(process.cwd(), '/src/lib/equipment/circuit.js'))
//
// /*
//
// 09:55:04.008 DEBUG Msg# 12 Incoming controller packet: 165,33,15,16,10,12,2,87,116,114,70,97,108,108,32,50,0,251,5,6
// 09:55:04.192 DEBUG Msg# 13 Incoming controller packet: 165,33,15,16,10,12,3,87,116,114,70,97,108,108,32,51,0,251,5,8
// 09:55:05.055 DEBUG Msg# 16 Incoming controller packet: 165,33,15,16,10,12,5,85,83,69,82,78,65,77,69,45,48,54,3,243
// 09:55:05.201 DEBUG Msg# 17 Incoming controller packet: 165,33,15,16,10,12,6,85,83,69,82,78,65,77,69,45,
// 09:55:05.374 DEBUG Msg# 18 Incoming controller packet: 165,33,15,16,10,12,7,85,83,69,82,78,65,77,69,45
// 09:55:05.550 DEBUG Msg# 19 Incoming controller packet: 165,33,15,16,10,12,8,85,83,69,82,78,65,77,69,45,48,57,3,249
// 09:55:05.728 DEBUG Msg# 20 Incoming controller packet: 165,33,15,16,10,12,9,85,83,69,82,78,65,77,69,45
// 09:55:05.749 INFO
// Custom Circuit Names retrieved from configuration:
// ["WtrFall 1","WtrFall 1.5","WtrFall 2","WtrFall 3","Pool Low2","USERNAME-06","USERNAME-07","USERNAME-08","USERNAME-09","USERNAME-10"]
// */
//
// describe('circuit controller', function() {
//
// describe('#sets the friendlyNames', function() {
//
// before(function() {
// global.initAllAsync()
// });
// var equip = 'controller'
// before(function() {
// return global.initAllAsync()
//
// beforeEach(function() {
// sandbox = sinon.sandbox.create()
// clock = sandbox.useFakeTimers()
// loggerInfoStub = sandbox.stub(bottle.container.logger, 'info')
// loggerWarnStub = sandbox.spy(bottle.container.logger, 'warn')
// loggerVerboseStub = sandbox.stub(bottle.container.logger, 'verbose')
// loggerDebugStub = sandbox.stub(bottle.container.logger, 'debug')
// loggerSillyStub = sandbox.stub(bottle.container.logger, 'silly')
// });
//
// beforeEach(function() {
// loggers = setupLoggerStubOrSpy('stub', 'stub')
// clock = sandbox.useFakeTimers()
//
// updateAvailStub = sandbox.stub(bottle.container.updateAvailable, 'getResultsAsync').returns(Promise.resolve({}))
// })
//
// afterEach(function() {
// //restore the sandbox after each function
// sandbox.restore()
//
//
// })
//
// after(function() {
// global.stopAllAsync()
// return global.stopAllAsync()
// })
//
// it('sets the names for circuits other than pool and spa', function() {
// var queuePacketStub = sinon.stub()
// var loggerInfoStub = sinon.stub()
//
// var fnArr = JSON.parse(fs.readFileSync(path.join(process.cwd(), '/specs/assets/config', 'configFriendlyNames.json'), 'utf8'))
// //var _response = {}
// myModule.__with__({
Expand Down
Loading

0 comments on commit 9e870c2

Please sign in to comment.