mirror of
https://github.com/zyphlar/easy-usb-relay.git
synced 2024-03-08 07:57:47 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df4fa8fb5b |
@@ -69,14 +69,17 @@ class Board {
|
|||||||
}
|
}
|
||||||
|
|
||||||
allOn() {
|
allOn() {
|
||||||
this.trigger([ALL_ON])
|
this.trigger([ALL_ON, 0])
|
||||||
}
|
}
|
||||||
|
|
||||||
allOff() {
|
allOff() {
|
||||||
this.trigger([ALL_OFF])
|
this.trigger([ALL_OFF, 0])
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger(state) {
|
trigger(state) {
|
||||||
|
if (state.length != 2) {
|
||||||
|
throw new Error('easy-usb-relay library error: exactly two arguments required for trigger function.')
|
||||||
|
}
|
||||||
this.logState()
|
this.logState()
|
||||||
this.board.sendFeatureReport(state)
|
this.board.sendFeatureReport(state)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user