Skip to content

Commit b4ab479

Browse files
committed
Keep relays off while testing connections. Prep 0.3.2
1 parent f209fb4 commit b4ab479

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TEST_FILES = test-status.js \
2626

2727
DESTDIR ?=
2828

29-
PKGVERSION ?= 0.3.1
29+
PKGVERSION ?= 0.3.2
3030

3131
# Where any app files are installed
3232
RUNDIR = /usr/share/brewable

makeself.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
NODEEXE=$(which node)
44
BREWTEMPDIR=`mktemp -d /tmp/brewtemp.XXXXXX` || exit 1
55
TARGET=$(pwd)/brewable
6-
VERSION=0.3.1
6+
VERSION=0.3.2
77

88
echo './node brewableserverbundle.js "$@"' > $BREWTEMPDIR/run.sh
99
chmod a+x $BREWTEMPDIR/run.sh

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"clean": "rm -r build/*"
99
},
1010
"name": "brewable",
11-
"version": "0.3.1",
11+
"version": "0.3.2",
1212
"description": "Nodejs version of brewable",
1313
"main": "src/scripts/brewable.js",
1414
"devDependencies": {

src/scripts/modules/sainsmartrelay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function Relay () {
5454
for (var i=0;i<PossibleRelayPins.length;i++) {
5555
rpio.close(PossibleRelayPins[i]);
5656
//console.log("Pins: " + PossibleRelayPins[i]);
57-
rpio.open(PossibleRelayPins[i], rpio.OUTPUT, rpio.LOW);
57+
rpio.open(PossibleRelayPins[i], rpio.OUTPUT, RELAY_OFF);
5858
}
5959
for (i=0;i<PossibleRelayPins.length;i++) {
6060
rpio.mode(PossibleRelayPins[i], rpio.INPUT);

test-status.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,37 @@ console.log("options: " + JSON.stringify(options));
1919
if ("port" in options) options.port = parseInt(options.port);
2020
console.log("options: " + JSON.stringify(options));
2121

22+
class Rectangle {
23+
constructor(height, width) {
24+
this.height = height;
25+
this.width = width;
26+
}
27+
28+
get area() {
29+
return this.height * this.width;
30+
}
31+
32+
speak() {
33+
console.log("I am not an animal");
34+
}
35+
}
36+
37+
var square = new Rectangle(10,10);
38+
console.log("Area = " + square.area);
39+
40+
class Dog extends Rectangle {
41+
constructor (w,h) {
42+
super(w,h);
43+
}
44+
speak() {
45+
super.speak();
46+
console.log("Woof " + this.area);
47+
}
48+
}
49+
var d = new Dog(5,5);
50+
d.speak();
51+
52+
2253
process.exit();
2354

2455
/* Physical numbering */

0 commit comments

Comments
 (0)