Forward browser_id in service calls from frontend

This commit is contained in:
thomas committed 2022-07-25 00:02:35 +00:00
1 parent 23cbdaef2d
commit 8dbd00aa0f
4 files changed
+22 -8

No files matched your search

+2 -2
View File
@@ -32,8 +32,8 @@ import { BrowserIDMixin } from "./browserID";
x Information about interaction requirement
x Information about fullykiosk
- Commands
- Change targets from the frontend
- Send browser ID to the backend in service calls?
x Change targets from the frontend
x Send browser ID to the backend in service calls?
x Rename browser_mod commands to browser_mod services
x Framework
x ll-custom handling
+7 -2
View File
@@ -95,10 +95,15 @@ export const ServicesMixin = (SuperClass) => {
async _service_action({ service, data }) {
let _service: String = service;
if (!_service.startsWith("browser_mod.") && _service.includes(".")) {
if (
(!_service.startsWith("browser_mod.") && _service.includes(".")) ||
data.browser_id !== undefined
) {
const d = { ...data };
if (d.browser_id === "THIS") d.browser_id = this.browserID;
// CALL HOME ASSISTANT SERVICE
const [domain, srv] = _service.split(".");
return this.hass.callService(domain, srv, data);
return this.hass.callService(domain, srv, d);
}
if (_service.startsWith("browser_mod.")) {