From 3bbb4f4c2832413c4ed3a3805a4bd95c3e0d992b Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Tue, 13 Feb 2024 15:21:42 +0100 Subject: [PATCH] fix(wirepas): improve lightbulb display --- src/wirepas/WirepasGatewayTile.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wirepas/WirepasGatewayTile.tsx b/src/wirepas/WirepasGatewayTile.tsx index b5429209..2608822b 100644 --- a/src/wirepas/WirepasGatewayTile.tsx +++ b/src/wirepas/WirepasGatewayTile.tsx @@ -32,6 +32,7 @@ import { useSettings } from '../context/Settings.js' import { useWebsocket } from '../context/WebsocketConnection.js' import { ButtonPressDiff } from '../ButtonPress.js' import type { ButtonPress as ButtonPressData } from '../context/Devices.js' +import { sum } from 'lodash-es' export const WirepasGatewayTile = ({ gateway, @@ -134,7 +135,8 @@ const Node = ({ b: false, ...(node.payload?.led ?? {}), } - const color = [r ? 255 : 128, g ? 255 : 128, b ? 255 : 128] + const color = [r ? 255 : 0, g ? 255 : 0, b ? 255 : 0] + const noColor = sum(color) === 0 const { settings: { managementCodes }, } = useSettings() @@ -161,10 +163,10 @@ const Node = ({ ) : (