homebridge-shelly-blu-trv 1.1.1 → 1.1.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.
- package/dist/shellyApi.js +5 -4
- package/package.json +1 -1
package/dist/shellyApi.js
CHANGED
|
@@ -45,6 +45,7 @@ class ShellyApi {
|
|
|
45
45
|
}
|
|
46
46
|
async rpcCall(id, method, params) {
|
|
47
47
|
// Try several RPC variants for wider compatibility with firmware differences
|
|
48
|
+
const quotedMethod = `"${method}"`;
|
|
48
49
|
const paramsStr = params ? `¶ms=${encodeURIComponent(JSON.stringify(params))}` : '';
|
|
49
50
|
// Try direct GetStatus endpoints first (some firmwares expose dedicated GET endpoints)
|
|
50
51
|
const candidates = [];
|
|
@@ -53,10 +54,10 @@ class ShellyApi {
|
|
|
53
54
|
candidates.push(`/rpc/BluTrv.GetStatus&id=${id}`);
|
|
54
55
|
}
|
|
55
56
|
// Common CALL variants (different firmware use call vs Call and different query separators)
|
|
56
|
-
candidates.push(`/rpc/BluTrv.Call?id=${id}&method=${
|
|
57
|
-
candidates.push(`/rpc/BluTrv.call?id=${id}&method=${
|
|
58
|
-
candidates.push(`/rpc/BluTrv.Call&id=${id}&method=${
|
|
59
|
-
candidates.push(`/rpc/BluTrv.call&id=${id}&method=${
|
|
57
|
+
candidates.push(`/rpc/BluTrv.Call?id=${id}&method=${quotedMethod}${paramsStr}`);
|
|
58
|
+
candidates.push(`/rpc/BluTrv.call?id=${id}&method=${quotedMethod}${paramsStr}`);
|
|
59
|
+
candidates.push(`/rpc/BluTrv.Call&id=${id}&method=${quotedMethod}${paramsStr}`);
|
|
60
|
+
candidates.push(`/rpc/BluTrv.call&id=${id}&method=${quotedMethod}${paramsStr}`);
|
|
60
61
|
for (const path of candidates) {
|
|
61
62
|
try {
|
|
62
63
|
return await this.get(path);
|
package/package.json
CHANGED