homebridge-rpi 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,10 +26,10 @@ class LedChainAccessory extends RpiAccessory.GpioAccessory {
|
|
|
26
26
|
this.ledChain.on('error', (error) => { this.warn(error) })
|
|
27
27
|
this.ledChain
|
|
28
28
|
.on('connect', (hostname, port) => {
|
|
29
|
-
this.
|
|
29
|
+
this.log('connected to %s:%s', hostname, port)
|
|
30
30
|
})
|
|
31
31
|
.on('disconnect', (hostname, port) => {
|
|
32
|
-
this.
|
|
32
|
+
this.log('disconnected from %s:%s', hostname, port)
|
|
33
33
|
})
|
|
34
34
|
.on('led', (id, led) => { this.vdebug('led %d: send %j', id, led) })
|
|
35
35
|
this.services = []
|
package/lib/RpiAccessory.js
CHANGED
|
@@ -35,7 +35,9 @@ class RpiAccessory extends AccessoryDelegate {
|
|
|
35
35
|
.on('error', (error) => { this.warn(error) })
|
|
36
36
|
.on('warning', (error) => { this.warn(error) })
|
|
37
37
|
.on('connect', async (hostname, port) => {
|
|
38
|
-
this.
|
|
38
|
+
this.log('connected to %s:%s', hostname, port)
|
|
39
|
+
})
|
|
40
|
+
.on('ready', async () => {
|
|
39
41
|
try {
|
|
40
42
|
await this.init()
|
|
41
43
|
} catch (error) {
|
|
@@ -43,7 +45,7 @@ class RpiAccessory extends AccessoryDelegate {
|
|
|
43
45
|
}
|
|
44
46
|
})
|
|
45
47
|
.on('disconnect', (hostname, port) => {
|
|
46
|
-
this.
|
|
48
|
+
this.log('disconnected from %s:%s', hostname, port)
|
|
47
49
|
this.setFault(true)
|
|
48
50
|
for (const key in this.gpioAccessories) {
|
|
49
51
|
this.gpioAccessories[key].setFault(true)
|
|
@@ -58,7 +60,6 @@ class RpiAccessory extends AccessoryDelegate {
|
|
|
58
60
|
.on('send', (data) => { this.vvdebug('send: %j', toHexString(data)) })
|
|
59
61
|
.on('data', (data) => { this.vvdebug('recv: %j', toHexString(data)) })
|
|
60
62
|
.on('message', (message) => { this.debug(message) })
|
|
61
|
-
|
|
62
63
|
.on('listen', (map) => {
|
|
63
64
|
this.debug('listen map: [%s]', this.pi.vmap(map))
|
|
64
65
|
})
|
|
@@ -161,14 +162,14 @@ class RpiAccessory extends AccessoryDelegate {
|
|
|
161
162
|
}
|
|
162
163
|
if (this.usesGpio) {
|
|
163
164
|
try {
|
|
164
|
-
await this.pi.command(this.pi.commands.
|
|
165
|
+
await this.pi.command(this.pi.commands.TICK)
|
|
165
166
|
} catch (error) {
|
|
166
167
|
this.warn(error)
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
} else { // Remote Pi
|
|
170
|
-
if (this.hidden && this.powerLedService == null) {
|
|
171
|
-
await this.pi.command(this.pi.commands.
|
|
171
|
+
if (this.hidden && this.powerLedService == null && this.fanService == null) {
|
|
172
|
+
await this.pi.command(this.pi.commands.TICK)
|
|
172
173
|
} else {
|
|
173
174
|
await this.pi.shell('getState')
|
|
174
175
|
const text = await this.pi.readFile('/tmp/getState.json')
|
|
@@ -180,7 +181,9 @@ class RpiAccessory extends AccessoryDelegate {
|
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
if (state != null) {
|
|
185
|
+
this.debug('state: %j', state)
|
|
186
|
+
}
|
|
184
187
|
if (!this.hidden) {
|
|
185
188
|
this.rpiService.checkState(state)
|
|
186
189
|
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"ebaauw"
|
|
8
8
|
],
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
|
-
"version": "2.0.
|
|
10
|
+
"version": "2.0.2",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"homebridge-plugin",
|
|
13
13
|
"raspberrypi",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"rpi": "cli/rpi.js"
|
|
24
24
|
},
|
|
25
25
|
"engines": {
|
|
26
|
-
"homebridge": "^1.11.
|
|
26
|
+
"homebridge": "^1.11.4||^2.0.0-beta",
|
|
27
27
|
"node": "^24||^22||^20"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"hb-rpi-tools": "~1.0.
|
|
31
|
-
"homebridge-lib": "~
|
|
30
|
+
"hb-rpi-tools": "~1.0.2",
|
|
31
|
+
"homebridge-lib": "~8.0.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"prepare": "standard",
|