diff --git a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap index b3bbeb4..c1dc644 100644 --- a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap @@ -35,13 +35,27 @@ exports[`DigitalTwinTab Render 1`] = ` true
-

- +

+

Battery - - : - 95% -

+

+

+ + Percentage + + : + 95% +

+

+ + Total Mileage + + : + unknown +

+
@@ -102,14 +116,14 @@ exports[`DigitalTwinTab Render 1`] = ` driver : - Closed + Unlocked

all : - Locked + Unlocked

(

{key}: {value} @@ -23,33 +27,46 @@ const windowState = (value) => { const DigitalTwin = (props) => { const classes = useStyles(); - const { battery, doors, location, trex_version, ip, updated, windows, misc_windows, sunroof, dbc_version, door_locks } = props; + const { battery, doors, location, trex_version, ip, updated, windows, misc_windows, sunroof, dbc_version, door_locks, vcu0x260, charging_metrics } = props; return (

- {!battery && !doors && !location && !windows && ( + {!battery && !doors && !location && !windows && !vcu0x260 && !charging_metrics && (

No vehicle data to display.

)} - {battery != null && keyValueTemplate("Battery", `${battery.percent}%`)} - {doors != null && ( + {battery && ( +
+

Battery

+ {keyValueTemplate("Percentage", `${battery.percent || 0}%`)} + {keyValueTemplate("Total Mileage", `${battery.total_mileage_odometer || UNKNOWN}`)} +
+ )} + {(vcu0x260 || charging_metrics) && ( +
+

Charging

+ {keyValueTemplate("Charge Type", vcu0x260?.charge_type || UNKNOWN)} + {keyValueTemplate("Remaining Time", charging_metrics?.remaining_charging_time || UNKNOWN)} +
+ )} + {doors && (

Doors

{Object.entries(doors).map(mapOpenCloseState)}
)} - {door_locks != null && ( + {door_locks && (

Door Locks

{Object.entries(door_locks).map((value) => { if (value[0] === "driver") { - return keyValueTemplate(value[0], value[1] ? "Open" : "Closed"); + return keyValueTemplate(value[0], value[1] ? LOCKED : UNLOCKED); } else { - return keyValueTemplate(value[0], value[1] ? "Unlocked" : "Locked"); + return keyValueTemplate(value[0], value[1] ? LOCKED : UNLOCKED); } })}
)} - {windows != null && ( + {windows && (

Windows

{Object.entries(windows).map((value) => { @@ -57,7 +74,7 @@ const DigitalTwin = (props) => { })}
)} - {misc_windows != null && ( + {misc_windows && (

Misc Windows

{Object.entries(misc_windows).map((value) => { @@ -65,7 +82,7 @@ const DigitalTwin = (props) => { })}
)} - {sunroof != null && ( + {sunroof && (

Sunroof

{Object.entries(sunroof).map((value) => { @@ -73,7 +90,7 @@ const DigitalTwin = (props) => { })}
)} - {location != null && ( + {location && (

Location

{Object.entries(location).map((value) => {