CEC-5931 - Remove nonexistent remote commands
This commit is contained in:
@@ -52,16 +52,6 @@ exports[`RemoteCommandsTab Render 1`] = `
|
||||
>
|
||||
Unlock doors
|
||||
</option>
|
||||
<option
|
||||
value="vent_windows"
|
||||
>
|
||||
Vent windows
|
||||
</option>
|
||||
<option
|
||||
value="close_windows"
|
||||
>
|
||||
Close windows
|
||||
</option>
|
||||
<option
|
||||
value="flash_headlights"
|
||||
>
|
||||
@@ -77,11 +67,6 @@ exports[`RemoteCommandsTab Render 1`] = `
|
||||
>
|
||||
Alert
|
||||
</option>
|
||||
<option
|
||||
value="precondition"
|
||||
>
|
||||
Precondition
|
||||
</option>
|
||||
<option
|
||||
value="california_mode"
|
||||
>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {Grid, Slider, Switch} from "@material-ui/core";
|
||||
import { Grid, Slider, Switch } from "@material-ui/core";
|
||||
import Typography from "@material-ui/core/Typography";
|
||||
|
||||
const tempMarks = [...[{value: 0, label: "Off"}, {value: 1, label: "On"},],
|
||||
...Array.from({length: 26}, (_, i) => {
|
||||
return {value: i + 2, label: `${i + 15}°C`}
|
||||
})];
|
||||
const tempMarks = [...[{ value: 0, label: "Off" }, { value: 1, label: "On" },],
|
||||
...Array.from({ length: 26 }, (_, i) => {
|
||||
return { value: i + 2, label: `${i + 15}°C` }
|
||||
})];
|
||||
|
||||
const valuetext = (value) => {
|
||||
return `${value}`;
|
||||
@@ -20,50 +20,18 @@ const highMidLowOffMarks = [{
|
||||
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 labelRemoved = (marks) => Array.from(marks).map((mark) => {
|
||||
return {value: mark.value}
|
||||
return { value: mark.value }
|
||||
})
|
||||
|
||||
const Commands = [
|
||||
{value: "doors_lock", label: "Lock 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: "trunk_close", label: "Close trunk"},
|
||||
{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: "doors_lock", label: "Lock doors" },
|
||||
{ value: "doors_unlock", label: "Unlock doors" },
|
||||
{ value: "flash_headlights", label: "Flash headlights" },
|
||||
{ value: "trunk_close", label: "Close trunk" },
|
||||
{ value: "alert", label: "Alert" },
|
||||
{
|
||||
value: "california_mode", label: "California mode", params: {
|
||||
dataFunc: (val, handleValChange) => {
|
||||
@@ -71,42 +39,42 @@ const Commands = [
|
||||
val = false
|
||||
}
|
||||
return <span>
|
||||
<Typography id="california_mode-slider" gutterBottom>
|
||||
Set California mode
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC"/>
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
</span>
|
||||
<Typography id="california_mode-slider" gutterBottom>
|
||||
Set California mode
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC" />
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
</span>
|
||||
},
|
||||
},
|
||||
}, {
|
||||
value: "trunk_open", label: "Open trunk", params: {
|
||||
dataFunc: (val, handleValChange) => <span>
|
||||
<Typography id="trunk_open-slider" gutterBottom>
|
||||
Set trunk's openness level
|
||||
</Typography>
|
||||
<Slider
|
||||
defaultValue={1}
|
||||
value={val}
|
||||
getAriaValueText={valuetext}
|
||||
aria-label="Open trunk"
|
||||
aria-labelledby="trunk_open-slider"
|
||||
valueLabelDisplay="auto"
|
||||
step={1}
|
||||
marks
|
||||
size="small"
|
||||
min={1}
|
||||
max={5}
|
||||
onChange={handleValChange}
|
||||
/>
|
||||
</span>,
|
||||
<Typography id="trunk_open-slider" gutterBottom>
|
||||
Set trunk's openness level
|
||||
</Typography>
|
||||
<Slider
|
||||
defaultValue={1}
|
||||
value={val}
|
||||
getAriaValueText={valuetext}
|
||||
aria-label="Open trunk"
|
||||
aria-labelledby="trunk_open-slider"
|
||||
valueLabelDisplay="auto"
|
||||
step={1}
|
||||
marks
|
||||
size="small"
|
||||
min={1}
|
||||
max={5}
|
||||
onChange={handleValChange}
|
||||
/>
|
||||
</span>,
|
||||
}
|
||||
}, {
|
||||
value: "temp_cabin", label: "Set cabin temperature(°C)", params: {
|
||||
@@ -142,15 +110,15 @@ const Commands = [
|
||||
<Typography id="defrost-slider" gutterBottom>
|
||||
Set defrost
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC"/>
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC" />
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
</span>
|
||||
},
|
||||
|
||||
@@ -158,46 +126,46 @@ const Commands = [
|
||||
}, {
|
||||
value: "driver_seat_preheat", label: "Driver seat preheat", params: {
|
||||
dataFunc: (val, handleValChange) => <span>
|
||||
<Typography id="driver_seat_preheat-slider" gutterBottom>
|
||||
Set driver seat preheat
|
||||
</Typography>
|
||||
<Slider
|
||||
valueLabelFormat={labelFunc(highMidLowOffMarks)}
|
||||
getAriaValueText={labelFunc(highMidLowOffMarks)}
|
||||
defaultValue={0}
|
||||
value={val}
|
||||
aria-labelledby="driver_seat_preheat-slider"
|
||||
valueLabelDisplay="auto"
|
||||
step={null}
|
||||
min={0}
|
||||
max={3}
|
||||
marks={highMidLowOffMarks}
|
||||
size="small"
|
||||
onChange={handleValChange}
|
||||
/>
|
||||
</span>,
|
||||
<Typography id="driver_seat_preheat-slider" gutterBottom>
|
||||
Set driver seat preheat
|
||||
</Typography>
|
||||
<Slider
|
||||
valueLabelFormat={labelFunc(highMidLowOffMarks)}
|
||||
getAriaValueText={labelFunc(highMidLowOffMarks)}
|
||||
defaultValue={0}
|
||||
value={val}
|
||||
aria-labelledby="driver_seat_preheat-slider"
|
||||
valueLabelDisplay="auto"
|
||||
step={null}
|
||||
min={0}
|
||||
max={3}
|
||||
marks={highMidLowOffMarks}
|
||||
size="small"
|
||||
onChange={handleValChange}
|
||||
/>
|
||||
</span>,
|
||||
}
|
||||
}, {
|
||||
value: "passenger_seat_preheat", label: "Preheat passenger seat", params: {
|
||||
dataFunc: (val, handleValChange) => <span>
|
||||
<Typography id="passenger_seat_preheat-slider" gutterBottom>
|
||||
Set passenger seat preheat
|
||||
</Typography>
|
||||
<Slider
|
||||
valueLabelFormat={labelFunc(highMidLowOffMarks)}
|
||||
getAriaValueText={labelFunc(highMidLowOffMarks)}
|
||||
defaultValue={0}
|
||||
value={val}
|
||||
aria-labelledby="passenger_seat_preheat-slider"
|
||||
valueLabelDisplay="auto"
|
||||
step={null}
|
||||
min={0}
|
||||
max={3}
|
||||
marks={highMidLowOffMarks}
|
||||
size="small"
|
||||
onChange={handleValChange}
|
||||
/>
|
||||
</span>,
|
||||
<Typography id="passenger_seat_preheat-slider" gutterBottom>
|
||||
Set passenger seat preheat
|
||||
</Typography>
|
||||
<Slider
|
||||
valueLabelFormat={labelFunc(highMidLowOffMarks)}
|
||||
getAriaValueText={labelFunc(highMidLowOffMarks)}
|
||||
defaultValue={0}
|
||||
value={val}
|
||||
aria-labelledby="passenger_seat_preheat-slider"
|
||||
valueLabelDisplay="auto"
|
||||
step={null}
|
||||
min={0}
|
||||
max={3}
|
||||
marks={highMidLowOffMarks}
|
||||
size="small"
|
||||
onChange={handleValChange}
|
||||
/>
|
||||
</span>,
|
||||
}
|
||||
}, {
|
||||
value: "steering_wheel_preheat", label: "Preheat Steering wheel", params: {
|
||||
@@ -210,15 +178,15 @@ const Commands = [
|
||||
<Typography id="steering_wheel_preheat-slider" gutterBottom>
|
||||
Set steering wheel preheat on/off
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC"/>
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC" />
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
</span>
|
||||
},
|
||||
|
||||
@@ -233,15 +201,15 @@ const Commands = [
|
||||
<Typography id="charging-slider" gutterBottom>
|
||||
Set charging on/off
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC"/>
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
<Typography component="div">
|
||||
<Grid component="label" container alignItems="center" spacing={1}>
|
||||
<Grid item>Off</Grid>
|
||||
<Grid item>
|
||||
<Switch checked={val} onChange={handleValChange} name="checkedC" />
|
||||
</Grid>
|
||||
<Grid item>On</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
</span>
|
||||
},
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export const onOff = {
|
||||
export const onOffTemp = {
|
||||
0: "off",
|
||||
1: "on",
|
||||
...Object.fromEntries(Array.from({length: 26}, (_, i) => [i+2, `${i+15}`]))
|
||||
...Object.fromEntries(Array.from({ length: 26 }, (_, i) => [i + 2, `${i + 15}`]))
|
||||
}
|
||||
|
||||
export const precond = {
|
||||
@@ -24,9 +24,7 @@ export const hmol = {
|
||||
}
|
||||
|
||||
export const emptyCommands = [
|
||||
"doors_lock", "doors_unlock", "vent_windows",
|
||||
"close_windows", "trunk_close", "flash_headlights",
|
||||
"alert"
|
||||
"doors_lock", "doors_unlock", "trunk_close", "flash_headlights", "alert"
|
||||
]
|
||||
|
||||
export const onOffCommands = ["california_mode", "steering_wheel_preheat", "defrost", "charging"]
|
||||
|
||||
Reference in New Issue
Block a user