diff --git a/src/components/DigitalTwin/index.js b/src/components/DigitalTwin/index.js index 20acbfe..82b41dd 100644 --- a/src/components/DigitalTwin/index.js +++ b/src/components/DigitalTwin/index.js @@ -14,7 +14,7 @@ const mapOpenCloseState = (value) => const DigitalTwin = (props) => { const classes = useStyles(); - const { battery, doors, location, trex_version, ip, updated, windows, sunroof, dbc, door_locks } = props; + const { battery, doors, location, trex_version, ip, updated, windows,misc_windows ,sunroof, dbc, door_locks } = props; return (
@@ -47,7 +47,21 @@ const DigitalTwin = (props) => { if (value[1] === 0) { return keyValueTemplate(value[0], "closed"); } else { - return keyValueTemplate(value[0], `${value[1]}% open`); + const percentOpen = Math.min(value[1], 100); + return keyValueTemplate(value[0], `${percentOpen}% open`); + } + })} +
+ )} + {misc_windows != null && ( +
+

Misc Windows

+ {Object.entries(misc_windows).map((value) => { + if (value[1] === 0) { + return keyValueTemplate(value[0], "closed"); + } else { + const percentOpen = Math.min(value[1], 100); + return keyValueTemplate(value[0], `${percentOpen}% open`); } })}
@@ -55,7 +69,6 @@ const DigitalTwin = (props) => { {sunroof != null && (

Sunroof

- {/* {Object.entries(sunroof).map(mapOpenCloseState)} */} {Object.entries(sunroof).map((value) => { if (value[1] === 0) { return keyValueTemplate(value[0], "closed"); diff --git a/src/components/VehicleMap/index.jsx b/src/components/VehicleMap/index.jsx index ff61861..2069e51 100644 --- a/src/components/VehicleMap/index.jsx +++ b/src/components/VehicleMap/index.jsx @@ -185,16 +185,7 @@ const Component = () => { {carState ? (