homebridge-sensor-cmd-polling 2.50.8 → 2.50.10-beta.0
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.
- package/README.md +12 -1
- package/config.schema.json +7 -1
- package/dist/accessory.js +119 -32
- package/dist/accessory.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,14 @@ Originally, [homebridge-sensor-cmd](https://github.com/apexad/homebridge-sensor-
|
|
|
14
14
|
This fork keeps all original functionality but **adds automatic polling**.
|
|
15
15
|
Now, you can define a `pollingInterval` in the config so the plugin updates the sensor state automatically without waiting for HomeKit GET requests.
|
|
16
16
|
|
|
17
|
+
The polling implementation is robust against long-running commands and overlapping reads:
|
|
18
|
+
|
|
19
|
+
- no parallel command execution inside the plugin
|
|
20
|
+
- last valid sensor value is cached and reused on command errors
|
|
21
|
+
- empty or invalid stdout no longer falls back to `0`
|
|
22
|
+
- GET requests and background polling share the same cached state instead of racing each other
|
|
23
|
+
- optional `execTimeout` can abort stuck commands
|
|
24
|
+
|
|
17
25
|
---
|
|
18
26
|
|
|
19
27
|
## New Feature: Automatic Polling
|
|
@@ -42,10 +50,13 @@ Add this to the `accessories` section of Homebridge's `config.json` after instal
|
|
|
42
50
|
"name": "<name of the sensor>",
|
|
43
51
|
"type": "<sensor type: contact/motion/occupancy - default is contact>",
|
|
44
52
|
"command": "<command-line/shell command to execute>",
|
|
45
|
-
"pollingInterval": 30
|
|
53
|
+
"pollingInterval": 30,
|
|
54
|
+
"execTimeout": 5000
|
|
46
55
|
}
|
|
47
56
|
```
|
|
48
57
|
|
|
58
|
+
`execTimeout` is optional and uses milliseconds. Set it to `0` or omit it to disable the timeout.
|
|
59
|
+
|
|
49
60
|
---
|
|
50
61
|
|
|
51
62
|
## Original Author
|
package/config.schema.json
CHANGED
|
@@ -32,9 +32,15 @@
|
|
|
32
32
|
"type": "number",
|
|
33
33
|
"default": 0,
|
|
34
34
|
"description": "Optional: Poll the command automatically at this interval. Set 0 to disable polling."
|
|
35
|
+
},
|
|
36
|
+
"execTimeout": {
|
|
37
|
+
"title": "Command Timeout (milliseconds)",
|
|
38
|
+
"type": "number",
|
|
39
|
+
"default": 0,
|
|
40
|
+
"description": "Optional: Abort long-running commands after this timeout. Set 0 to disable the timeout."
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
44
|
"form": null,
|
|
39
45
|
"display": null
|
|
40
|
-
}
|
|
46
|
+
}
|
package/dist/accessory.js
CHANGED
|
@@ -3,7 +3,9 @@ const child_process_1 = require("child_process");
|
|
|
3
3
|
let hap;
|
|
4
4
|
class SensorCmd {
|
|
5
5
|
constructor(log, config) {
|
|
6
|
+
var _a;
|
|
6
7
|
this.log = log;
|
|
8
|
+
this.isShuttingDown = false;
|
|
7
9
|
this.config = config;
|
|
8
10
|
// Determine which sensor type to create
|
|
9
11
|
switch (this.config.type) {
|
|
@@ -19,15 +21,20 @@ class SensorCmd {
|
|
|
19
21
|
}
|
|
20
22
|
// Register the on-demand GET handler
|
|
21
23
|
const characteristic = this.getRelevantCharacteristic();
|
|
22
|
-
characteristic.on("get" /* GET */, (callback) => {
|
|
23
|
-
|
|
24
|
+
characteristic.on("get" /* CharacteristicEventTypes.GET */, (callback) => {
|
|
25
|
+
const result = this.getFallbackResult();
|
|
26
|
+
callback(null, result.value);
|
|
27
|
+
void this.refreshAfterGet();
|
|
24
28
|
});
|
|
25
29
|
// Accessory info
|
|
26
30
|
this.infoService = new hap.Service.AccessoryInformation()
|
|
27
31
|
.setCharacteristic(hap.Characteristic.Manufacturer, 'apexad')
|
|
28
32
|
.setCharacteristic(hap.Characteristic.Model, 'sensor-cmd');
|
|
29
33
|
// Polling interval (default 60s)
|
|
30
|
-
this.pollingInterval = this.config.pollingInterval ?
|
|
34
|
+
this.pollingInterval = (_a = this.config.pollingInterval) !== null && _a !== void 0 ? _a : 60;
|
|
35
|
+
this.execTimeout = this.config.execTimeout && this.config.execTimeout > 0
|
|
36
|
+
? this.config.execTimeout
|
|
37
|
+
: undefined;
|
|
31
38
|
if (this.pollingInterval > 0) {
|
|
32
39
|
this.log(`Starting automatic polling every ${this.pollingInterval}s`);
|
|
33
40
|
this.startPolling();
|
|
@@ -45,43 +52,123 @@ class SensorCmd {
|
|
|
45
52
|
return this.sensorService.getCharacteristic(hap.Characteristic.ContactSensorState);
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
let parsed = parseInt(stdout.trim(), 10);
|
|
57
|
-
if (isNaN(parsed))
|
|
58
|
-
parsed = 0;
|
|
59
|
-
callback(false, parsed);
|
|
60
|
-
});
|
|
55
|
+
/** Keep the previous valid value, falling back to 0 before the first successful read */
|
|
56
|
+
getFallbackResult() {
|
|
57
|
+
if (this.lastValidValue !== undefined) {
|
|
58
|
+
return { value: this.lastValidValue, source: 'cache' };
|
|
59
|
+
}
|
|
60
|
+
return { value: 0, source: 'default' };
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
/** Accept only explicit integer output, never treat empty/invalid stdout as 0 */
|
|
63
|
+
parseSensorValue(stdout) {
|
|
64
|
+
const trimmedOutput = stdout.trim();
|
|
65
|
+
if (trimmedOutput.length === 0) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
if (!/^-?\d+$/.test(trimmedOutput)) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return Number.parseInt(trimmedOutput, 10);
|
|
72
|
+
}
|
|
73
|
+
/** Run the configured command and update the characteristic only on fresh valid output */
|
|
74
|
+
runCommand() {
|
|
75
|
+
return new Promise((resolve) => {
|
|
76
|
+
const execOptions = this.execTimeout !== undefined
|
|
77
|
+
? { timeout: this.execTimeout }
|
|
78
|
+
: undefined;
|
|
79
|
+
(0, child_process_1.exec)(this.config.command, execOptions, (error, stdout, stderr) => {
|
|
80
|
+
const stdoutText = String(stdout);
|
|
81
|
+
const stderrText = String(stderr);
|
|
82
|
+
const trimmedStderr = stderrText.trim();
|
|
83
|
+
if (trimmedStderr.length > 0) {
|
|
84
|
+
this.log(`Command stderr: ${trimmedStderr}`);
|
|
85
|
+
}
|
|
86
|
+
if (error) {
|
|
87
|
+
this.log(`Command failed: ${error.message}`);
|
|
88
|
+
resolve(this.getFallbackResult());
|
|
89
|
+
return;
|
|
70
90
|
}
|
|
71
|
-
|
|
72
|
-
|
|
91
|
+
const parsedValue = this.parseSensorValue(stdoutText);
|
|
92
|
+
if (parsedValue === undefined) {
|
|
93
|
+
const trimmedStdout = stdoutText.trim();
|
|
94
|
+
if (trimmedStdout.length === 0) {
|
|
95
|
+
this.log('Command returned empty stdout, keeping last valid value');
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.log(`Command returned invalid stdout "${trimmedStdout}", keeping last valid value`);
|
|
99
|
+
}
|
|
100
|
+
resolve(this.getFallbackResult());
|
|
101
|
+
return;
|
|
73
102
|
}
|
|
103
|
+
this.lastValidValue = parsedValue;
|
|
104
|
+
this.getRelevantCharacteristic().updateValue(parsedValue);
|
|
105
|
+
resolve({ value: parsedValue, source: 'fresh' });
|
|
74
106
|
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/** Ensure there is at most one running command for polling and GET refreshes */
|
|
110
|
+
ensureCommandRunning(trigger) {
|
|
111
|
+
if (this.pendingCommand) {
|
|
112
|
+
if (trigger === 'get') {
|
|
113
|
+
const fallback = this.getFallbackResult();
|
|
114
|
+
this.log(`Command already running during GET, returning cached value ${fallback.value}`);
|
|
115
|
+
return this.pendingCommand;
|
|
116
|
+
}
|
|
117
|
+
this.log(`Command already running during ${trigger}, waiting for the current run to finish`);
|
|
118
|
+
return this.pendingCommand;
|
|
119
|
+
}
|
|
120
|
+
this.pendingCommand = this.runCommand()
|
|
121
|
+
.finally(() => {
|
|
122
|
+
this.pendingCommand = undefined;
|
|
123
|
+
});
|
|
124
|
+
return this.pendingCommand;
|
|
125
|
+
}
|
|
126
|
+
/** GET returns immediately and only triggers a background refresh */
|
|
127
|
+
async refreshAfterGet() {
|
|
128
|
+
try {
|
|
129
|
+
await this.ensureCommandRunning('get');
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
133
|
+
this.log(`Unexpected GET refresh error: ${message}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** Schedule the next poll only after the current run has finished */
|
|
137
|
+
scheduleNextPoll() {
|
|
138
|
+
if (this.isShuttingDown || this.pollingInterval <= 0) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.pollingTimer = setTimeout(() => {
|
|
142
|
+
this.pollingTimer = undefined;
|
|
143
|
+
void this.pollOnce();
|
|
144
|
+
}, this.pollingInterval * 1000);
|
|
145
|
+
}
|
|
146
|
+
/** Start polling without allowing overlapping runs */
|
|
147
|
+
startPolling() {
|
|
148
|
+
void this.pollOnce();
|
|
149
|
+
}
|
|
150
|
+
async pollOnce() {
|
|
151
|
+
try {
|
|
152
|
+
const result = await this.ensureCommandRunning('poll');
|
|
153
|
+
if (result.source === 'fresh') {
|
|
154
|
+
this.log(`Polled value: ${result.value}`);
|
|
155
|
+
}
|
|
156
|
+
else if (result.source === 'cache') {
|
|
157
|
+
this.log(`Polling reused cached value: ${result.value}`);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this.log('Polling has no valid sensor value yet, leaving current characteristic unchanged');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
this.scheduleNextPoll();
|
|
165
|
+
}
|
|
80
166
|
}
|
|
81
167
|
/** Clean up when accessory is unloaded */
|
|
82
168
|
shutdown() {
|
|
169
|
+
this.isShuttingDown = true;
|
|
83
170
|
if (this.pollingTimer) {
|
|
84
|
-
|
|
171
|
+
clearTimeout(this.pollingTimer);
|
|
85
172
|
this.pollingTimer = undefined;
|
|
86
173
|
}
|
|
87
174
|
}
|
package/dist/accessory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessory.js","sourceRoot":"","sources":["../src/accessory.ts"],"names":[],"mappings":";AAUA,iDAAqC;AAErC,IAAI,GAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"accessory.js","sourceRoot":"","sources":["../src/accessory.ts"],"names":[],"mappings":";AAUA,iDAAqC;AAErC,IAAI,GAAQ,CAAC;AAuBb,MAAM,SAAS;IAWX,YAA6B,GAAY,EAAE,MAAuB;;QAArC,QAAG,GAAH,GAAG,CAAS;QAFjC,mBAAc,GAAG,KAAK,CAAC;QAG3B,IAAI,CAAC,MAAM,GAAG,MAAyB,CAAC;QAExC,wCAAwC;QACxC,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACvB,KAAK,QAAQ;gBACT,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACpE,MAAM;YACV,KAAK,WAAW;gBACZ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACvE,MAAM;YACV,KAAK,SAAS,CAAC;YACf;gBACI,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7E,CAAC;QAED,qCAAqC;QACrC,MAAM,cAAc,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;Q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-polling",
|
|
3
|
-
"version": "2.50.
|
|
3
|
+
"version": "2.50.10-beta.0",
|
|
4
4
|
"description": "Fork of apexad/homebridge-sensor-cmd with automatic polling support (configurable interval) – original minimal contact sensor via shell command",
|
|
5
5
|
"main": "dist/accessory.js",
|
|
6
6
|
"scripts": {
|