From 2e791f80b8f08ab0db469c0d24453903fed7eed8 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Fri, 2 Jun 2023 21:41:16 -0600 Subject: Se corrige candado para Suntech nuevos --- modern/src/DevicesList.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js index fb89260..7a60e8e 100644 --- a/modern/src/DevicesList.js +++ b/modern/src/DevicesList.js @@ -117,6 +117,17 @@ const DeviceRow = ({ data, index, style }) => { return null; } + const getPositionLock = (pos) => { + if (pos) { + if (pos.attributes.output !== undefined) { + return pos.attributes.output === 1; + } else if (pos.attributes.out1 !== undefined) { + return pos.attributes.out1; + } + } + return null; + } + return (
{ @@ -135,10 +146,10 @@ const DeviceRow = ({ data, index, style }) => { - {position && position.attributes.out1 == false && ( + {getPositionLock(position) === false && ( )} - {position && position.attributes.out1 == true && ( + {getPositionLock(position) === true && ( )} {` ${item.name}`} -- cgit v1.2.3