Merge pull request #516 from Fisker-Inc/CEC-5931

CEC-5931
This commit is contained in:
Paul Adamsen
2024-04-09 19:51:32 -04:00
committed by GitHub
4 changed files with 121 additions and 172 deletions

View File

@@ -52,16 +52,6 @@ exports[`RemoteCommandsTab Render 1`] = `
> >
Unlock doors Unlock doors
</option> </option>
<option
value="vent_windows"
>
Vent windows
</option>
<option
value="close_windows"
>
Close windows
</option>
<option <option
value="flash_headlights" value="flash_headlights"
> >
@@ -77,11 +67,6 @@ exports[`RemoteCommandsTab Render 1`] = `
> >
Alert Alert
</option> </option>
<option
value="precondition"
>
Precondition
</option>
<option <option
value="california_mode" value="california_mode"
> >

View File

@@ -20,13 +20,6 @@ const highMidLowOffMarks = [{
value: 0, label: "Off", value: 0, label: "Off",
},] },]
const precondMarks = [
{value: 0, label: "Battery"},
{value: 1, label: "All"},
{value: 2, label: "Climate"},
{value: 3, label: "Stop"},
]
const labelFunc = (marks) => (value) => marks.find(mark => mark.value === value)?.label; const labelFunc = (marks) => (value) => marks.find(mark => mark.value === value)?.label;
const labelRemoved = (marks) => Array.from(marks).map((mark) => { const labelRemoved = (marks) => Array.from(marks).map((mark) => {
@@ -36,34 +29,9 @@ const labelRemoved = (marks) => Array.from(marks).map((mark) => {
const Commands = [ const Commands = [
{ value: "doors_lock", label: "Lock doors" }, { value: "doors_lock", label: "Lock doors" },
{ value: "doors_unlock", label: "Unlock doors" }, { value: "doors_unlock", label: "Unlock doors" },
{value: "vent_windows", label: "Vent windows"},
{value: "close_windows", label: "Close windows"},
{ value: "flash_headlights", label: "Flash headlights" }, { value: "flash_headlights", label: "Flash headlights" },
{ value: "trunk_close", label: "Close trunk" }, { value: "trunk_close", label: "Close trunk" },
{ value: "alert", label: "Alert" }, { value: "alert", label: "Alert" },
{
value: "precondition", label: "Precondition", params: {
dataFunc: (val, handleValChange) => <span>
<Typography id="precondition-slider" gutterBottom>
Set driver seat preheat
</Typography>
<Slider
valueLabelFormat={labelFunc(precondMarks)}
getAriaValueText={labelFunc(precondMarks)}
defaultValue={0}
value={val}
aria-labelledby="precondition-slider"
valueLabelDisplay="auto"
step={null}
min={0}
max={3}
marks={precondMarks}
size="small"
onChange={handleValChange}
/>
</span>,
}
},
{ {
value: "california_mode", label: "California mode", params: { value: "california_mode", label: "California mode", params: {
dataFunc: (val, handleValChange) => { dataFunc: (val, handleValChange) => {

View File

@@ -24,9 +24,7 @@ export const hmol = {
} }
export const emptyCommands = [ export const emptyCommands = [
"doors_lock", "doors_unlock", "vent_windows", "doors_lock", "doors_unlock", "trunk_close", "flash_headlights", "alert"
"close_windows", "trunk_close", "flash_headlights",
"alert"
] ]
export const onOffCommands = ["california_mode", "steering_wheel_preheat", "defrost", "charging"] export const onOffCommands = ["california_mode", "steering_wheel_preheat", "defrost", "charging"]

View File

@@ -1,8 +1,6 @@
const Commands = [ const Commands = [
{ value: "doors_lock", label: "Lock doors" }, { value: "doors_lock", label: "Lock doors" },
{ value: "doors_unlock", label: "Unlock doors" }, { value: "doors_unlock", label: "Unlock doors" },
{value: "vent_windows", label: "Vent windows"},
{value: "close_windows", label: "Close windows"},
{ value: "california_mode", label: "California mode" }, { value: "california_mode", label: "California mode" },
{ value: "trunk_open", label: "Open trunk" }, { value: "trunk_open", label: "Open trunk" },
{ value: "trunk_close", label: "Close trunk " }, { value: "trunk_close", label: "Close trunk " },