@glasshome/sync-layer 0.5.0 → 0.7.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/dist/calendar/track.d.ts +19 -0
- package/dist/calendar/types.d.ts +32 -0
- package/dist/core/privileged-conn.d.ts +29 -0
- package/dist/core/store.d.ts +3 -2
- package/dist/host-api.d.ts +50 -0
- package/dist/index.d.ts +16 -7
- package/dist/index.js +168 -2369
- package/dist/solid/hooks.d.ts +11 -1
- package/dist/solid/index.d.ts +1 -1
- package/dist/solid/index.js +21 -3
- package/dist/statistics-CtRfIF6D.js +2175 -0
- package/dist/worker/protocol.d.ts +4 -0
- package/dist/worker/worker-main.js +1 -1
- package/dist/{worker-main-Cf-k4f2N.js → worker-main-C-3QM4di.js} +5 -3
- package/package.json +2 -2
|
@@ -113,10 +113,14 @@ export interface WidgetServiceCall {
|
|
|
113
113
|
service: string;
|
|
114
114
|
data?: Record<string, unknown>;
|
|
115
115
|
target?: Record<string, unknown>;
|
|
116
|
+
/** Opt in to HA's service response (return_response). Only set for services
|
|
117
|
+
that support/require it; HA errors otherwise. */
|
|
118
|
+
returnResponse?: boolean;
|
|
116
119
|
}
|
|
117
120
|
export type WidgetServiceResult = {
|
|
118
121
|
id: number;
|
|
119
122
|
ok: true;
|
|
123
|
+
result?: unknown;
|
|
120
124
|
} | {
|
|
121
125
|
id: number;
|
|
122
126
|
ok: false;
|
|
@@ -239,16 +239,18 @@ function runHaBridgeWorker(scope) {
|
|
|
239
239
|
return;
|
|
240
240
|
}
|
|
241
241
|
try {
|
|
242
|
-
await conn.sendMessagePromise({
|
|
242
|
+
const res = await conn.sendMessagePromise({
|
|
243
243
|
type: "call_service",
|
|
244
244
|
domain: call.domain,
|
|
245
245
|
service: call.service,
|
|
246
246
|
service_data: call.data ?? {},
|
|
247
|
-
...call.target ? { target: call.target } : {}
|
|
247
|
+
...call.target ? { target: call.target } : {},
|
|
248
|
+
...call.returnResponse ? { return_response: true } : {}
|
|
248
249
|
});
|
|
249
250
|
reply({
|
|
250
251
|
id: call.id,
|
|
251
|
-
ok: true
|
|
252
|
+
ok: true,
|
|
253
|
+
...call.returnResponse ? { result: res.response } : {}
|
|
252
254
|
});
|
|
253
255
|
} catch (err) {
|
|
254
256
|
reply({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glasshome/sync-layer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Type-safe, reactive state synchronization layer for Home Assistant",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dist"
|
|
45
45
|
],
|
|
46
46
|
"scripts": {
|
|
47
|
-
"build": "tsdown && tsc --noEmit",
|
|
47
|
+
"build": "tsdown && tsc --noEmit && bun scripts/check-widget-reachable-surface.ts",
|
|
48
48
|
"dev": "tsdown --watch",
|
|
49
49
|
"test": "bun test",
|
|
50
50
|
"lint": "tsc --noEmit"
|