mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 18:10:47 -04:00
uhufgj
This commit is contained in:
@@ -11,6 +11,12 @@ if (!global.WebSocket) {
|
|||||||
|
|
||||||
function createTransport(deps) {
|
function createTransport(deps) {
|
||||||
const { logger, enabled, haConfig, onSnapshot, onStatus } = deps;
|
const { logger, enabled, haConfig, onSnapshot, onStatus } = deps;
|
||||||
|
function getCallerFrame() {
|
||||||
|
const stack = new Error().stack || '';
|
||||||
|
const lines = stack.split('\n').slice(2).map((line) => line.trim());
|
||||||
|
const frame = lines.find((line) => !line.includes('transport.js') && !line.includes('node:internal')) || null;
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
|
||||||
function buildAuth() {
|
function buildAuth() {
|
||||||
const token = haConfig?.token?.trim();
|
const token = haConfig?.token?.trim();
|
||||||
@@ -103,6 +109,7 @@ function createTransport(deps) {
|
|||||||
domain: String(domain),
|
domain: String(domain),
|
||||||
service: String(service),
|
service: String(service),
|
||||||
serviceData: serviceData && typeof serviceData === 'object' ? { ...serviceData } : serviceData,
|
serviceData: serviceData && typeof serviceData === 'object' ? { ...serviceData } : serviceData,
|
||||||
|
caller: getCallerFrame(),
|
||||||
});
|
});
|
||||||
await callService(runtime.connection, String(domain), String(service), serviceData || {});
|
await callService(runtime.connection, String(domain), String(service), serviceData || {});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user