add dallas parasite setting (fix #490), sort settings page

This commit is contained in:
MichaelDvP
2020-09-11 11:16:29 +02:00
parent be67c42059
commit fb05c13900
7 changed files with 52 additions and 8 deletions

View File

@@ -51,6 +51,10 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
Customize EMS-ESP by editing the default settings here. Refer to the <Link href="https://emsesp.github.io/docs/#/" color="primary">{'Wiki'}</Link>&nbsp;for descriptions of each setting.
</Typography>
</Box>
<br></br>
<Typography variant="h6" color="primary" >
EMS Bus Settings
</Typography>
<TextValidator
validators={['required', 'isNumber', 'minNumber:0', 'maxNumber:255']}
errorMessages={['TX mode is required', "Must be a number", "Must be 0 or higher", "Max value is 255"]}
@@ -100,6 +104,10 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
onChange={handleValueChange('tx_gpio')}
margin="normal"
/>
<br></br>
<Typography variant="h6" color="primary" >
Dallas Sensor Settings
</Typography>
<TextValidator
validators={['required', 'isNumber', 'minNumber:0', 'maxNumber:40']}
errorMessages={['Dallas GPIO is required', "Must be a number", "Must be 0 or higher", "Max value is 255"]}
@@ -112,7 +120,21 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
onChange={handleValueChange('dallas_gpio')}
margin="normal"
/>
<TextValidator
<BlockFormControlLabel
control={
<Checkbox
checked={data.dallas_parasite}
onChange={handleValueChange('dallas_parasite')}
value="dallas_parasite"
/>
}
label="Dallas Parasite Mode"
/>
<br></br>
<Typography variant="h6" color="primary" >
LED Settings
</Typography>
<TextValidator
validators={['required', 'isNumber', 'minNumber:0', 'maxNumber:40']}
errorMessages={['LED GPIO is required', "Must be a number", "Must be 0 or higher", "Max value is 255"]}
name="led_gpio"
@@ -134,6 +156,10 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
}
label="Invert/Hide LED"
/>
<br></br>
<Typography variant="h6" color="primary" >
Shower Settings
</Typography>
<BlockFormControlLabel
control={
<Checkbox
@@ -154,6 +180,10 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
}
label="Shower Alert"
/>
<br></br>
<Typography variant="h6" color="primary" >
Syslog Settings
</Typography>
<SelectValidator name="syslog_level"
label="Syslog Log Level"
value={data.syslog_level}

View File

@@ -7,11 +7,12 @@ export interface EMSESPSettings {
master_thermostat: number;
shower_timer: boolean;
shower_alert: boolean;
hide_led: boolean;
rx_gpio: number;
tx_gpio : number;
dallas_gpio : number;
dallas_parasite: boolean;
led_gpio : number;
hide_led: boolean;
}
export enum busConnectionStatus {