From e09d42ecf60717ae7e75c027f66e5f706cadd04a Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Mon, 14 Apr 2025 23:56:51 +0200 Subject: [PATCH] feat: add toggle to display remote control --- www/src/views/devices/integration-view.jsx | 58 +++++++++++++++------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/www/src/views/devices/integration-view.jsx b/www/src/views/devices/integration-view.jsx index ce2a8e4..378ae25 100644 --- a/www/src/views/devices/integration-view.jsx +++ b/www/src/views/devices/integration-view.jsx @@ -4,6 +4,7 @@ import { createResource, createSignal, onCleanup, + Show, } from "solid-js"; import WebRTCService from "../../services/webrtc-service"; import Integration from "../../data/integration"; @@ -37,8 +38,15 @@ function IntegrationView(props) { initialValue: [], }); const [selectedRemote, setSelectedRemote] = createSignal(); + const [remoteControlVisible, setRemoteControlVisible] = createSignal(false); - createEffect(() => handleRemoteSelected(availableRemotes().shift()?.getId())); + createEffect(() => + handleRemoteSelected( + availableRemotes() + .find(() => true) + ?.getId() + ) + ); createEffect(() => { let url = UrlUtils.getUrl(); @@ -90,6 +98,10 @@ function IntegrationView(props) { RemoteService.sendCommand(command); } + function toggleRemoteControl() { + setRemoteControlVisible(!remoteControlVisible()); + } + return (
-
+
-
-
- - + +
+ +
+ + +
+
);