homebridge-shelly-blu-trv 1.0.7 → 1.0.8
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 +35 -0
- package/config.schema.json +11 -0
- package/dist/platform.js +13 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,6 +97,41 @@ To ensure coverage is sufficient:
|
|
|
97
97
|
- Check coverage threshold (lines): `npm run check-coverage` (configured to require at least 80% lines by default, set `COVERAGE_THRESHOLD` env to override)
|
|
98
98
|
|
|
99
99
|
|
|
100
|
+
## Publishing
|
|
101
|
+
|
|
102
|
+
### Manual device configuration (fallback when discovery unavailable) ✅
|
|
103
|
+
|
|
104
|
+
If your Shelly BLU Gateway Gen3 does not expose the `/status` discovery endpoint (returns 404) or discovery is otherwise unavailable, you can manually configure TRV devices in the gateway entry of your Homebridge config. The plugin will use this list when discovery fails or returns no devices.
|
|
105
|
+
|
|
106
|
+
Example gateway configuration with manual devices:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"platforms": [
|
|
111
|
+
{
|
|
112
|
+
"platform": "ShellyBluTRV",
|
|
113
|
+
"gateways": [
|
|
114
|
+
{
|
|
115
|
+
"host": "10.0.0.171",
|
|
116
|
+
"token": "<optional-auth-token>",
|
|
117
|
+
"pollInterval": 60,
|
|
118
|
+
"devices": [
|
|
119
|
+
{ "id": 100, "name": "Living TRV" },
|
|
120
|
+
{ "id": 101, "name": "Kitchen TRV" }
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Notes:
|
|
130
|
+
|
|
131
|
+
- `id` is the TRV numeric id assigned by the gateway; the plugin uses this id for polling and state updates.
|
|
132
|
+
- If `name` is omitted, a default name `BLU TRV <id>` will be used.
|
|
133
|
+
- When both discovery and manual `devices` are available, discovery takes precedence.
|
|
134
|
+
|
|
100
135
|
## Publishing
|
|
101
136
|
|
|
102
137
|
- The repository contains two publishing workflows:
|
package/config.schema.json
CHANGED
|
@@ -24,6 +24,17 @@
|
|
|
24
24
|
"title": "Polling interval (seconds)",
|
|
25
25
|
"default": 60,
|
|
26
26
|
"minimum": 15
|
|
27
|
+
},
|
|
28
|
+
"devices": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"title": "Manual TRV devices (optional)",
|
|
31
|
+
"items": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"id": { "type": "number", "title": "TRV ID", "required": true },
|
|
35
|
+
"name": { "type": "string", "title": "Display name" }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
27
38
|
}
|
|
28
39
|
}
|
|
29
40
|
}
|
package/dist/platform.js
CHANGED
|
@@ -40,10 +40,21 @@ class ShellyBluPlatform {
|
|
|
40
40
|
try {
|
|
41
41
|
trvs = await api.discoverTrvs();
|
|
42
42
|
this.log.info(`[ShellyBluPlatform] Discovered ${trvs.length} TRV(s) on gateway ${gw.host}`);
|
|
43
|
+
// If discovery returned nothing but user provided manual devices, use them
|
|
44
|
+
if ((!trvs || trvs.length === 0) && gw.devices && gw.devices.length > 0) {
|
|
45
|
+
this.log.warn(`[ShellyBluPlatform] Discovery returned no devices; using manual device list for gateway ${gw.host}`);
|
|
46
|
+
trvs = gw.devices.map((d) => ({ id: d.id, name: d.name || `BLU TRV ${d.id}` }));
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
catch (error) {
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
if (gw.devices && gw.devices.length > 0) {
|
|
51
|
+
this.log.warn(`[ShellyBluPlatform] Discovery failed for gateway ${gw.host}, using manual device list: ${error instanceof Error ? error.message : String(error)}`);
|
|
52
|
+
trvs = gw.devices.map((d) => ({ id: d.id, name: d.name || `BLU TRV ${d.id}` }));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.log.error(`[ShellyBluPlatform] Failed to discover devices on gateway ${gw.host}: ${error instanceof Error ? error.message : String(error)}`);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
47
58
|
}
|
|
48
59
|
for (const trv of trvs) {
|
|
49
60
|
const uuid = this.api.hap.uuid.generate(`${gw.host}-${trv.id}`);
|
package/package.json
CHANGED