DS18S20 fix, sensors right align with 1 decimal, telegram counter 32 bit

This commit is contained in:
MichaelDvP
2020-08-30 14:27:11 +02:00
parent 76a394cc42
commit 8a98f7cac8
14 changed files with 74 additions and 70 deletions

View File

@@ -152,7 +152,7 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
<TableHead>
<TableRow>
<StyledTableCell>ID</StyledTableCell>
<StyledTableCell align="left">Temperature</StyledTableCell>
<StyledTableCell align="right">Temperature</StyledTableCell>
</TableRow>
</TableHead>
<TableBody>
@@ -161,8 +161,8 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
<TableCell component="th" scope="row">
{sensorData.id}
</TableCell>
<TableCell align="left">
{sensorData.temp}&deg;C
<TableCell align="right">
{sensorData.temp.toFixed(1)}&deg;C
</TableCell>
</TableRow>
))}
@@ -285,7 +285,7 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
<TableCell component="th" scope="row">
{deviceData.name}
</TableCell>
<TableCell align="left">
<TableCell align="right">
{deviceData.value}
</TableCell>
</TableRow>

View File

@@ -100,18 +100,6 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
onChange={handleValueChange('tx_gpio')}
margin="normal"
/>
<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"
label="LED GPIO pin (0=none)"
fullWidth
variant="outlined"
value={data.led_gpio}
type="number"
onChange={handleValueChange('led_gpio')}
margin="normal"
/>
<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"]}
@@ -124,6 +112,18 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
onChange={handleValueChange('dallas_gpio')}
margin="normal"
/>
<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"
label="LED GPIO pin (0=none)"
fullWidth
variant="outlined"
value={data.led_gpio}
type="number"
onChange={handleValueChange('led_gpio')}
margin="normal"
/>
<BlockFormControlLabel
control={
<Checkbox
@@ -132,7 +132,7 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
value="hide_led"
/>
}
label="Hide LED"
label="Invert/Hide LED"
/>
<BlockFormControlLabel
control={

View File

@@ -37,6 +37,10 @@ import {
import { EMSESPStatus } from "./EMSESPtypes";
function formatNumber(num: number) {
return new Intl.NumberFormat().format(num);
}
type EMSESPStatusFormProps = RestFormProps<EMSESPStatus> & WithTheme & WithWidthProps;
const StyledTableCell = withStyles((theme: Theme) =>
@@ -75,7 +79,7 @@ class EMSESPStatusForm extends Component<EMSESPStatusFormProps> {
<TableHead>
<TableRow>
<StyledTableCell>Statistic</StyledTableCell>
<StyledTableCell align="center"># Telegrams</StyledTableCell>
<StyledTableCell align="right"># Telegrams</StyledTableCell>
</TableRow>
</TableHead>
<TableBody>
@@ -83,25 +87,25 @@ class EMSESPStatusForm extends Component<EMSESPStatusFormProps> {
<TableCell>
(Rx) Received telegrams
</TableCell>
<TableCell align="center">{data.rx_received}</TableCell>
<TableCell align="right">{formatNumber(data.rx_received)}</TableCell>
</TableRow>
<TableRow>
<TableCell >
(Rx) Incomplete telegrams
</TableCell>
<TableCell align="center">{data.crc_errors}</TableCell>
<TableCell align="right">{formatNumber(data.crc_errors)}</TableCell>
</TableRow>
<TableRow>
<TableCell >
(Tx) Successfully sent telegrams
</TableCell>
<TableCell align="center">{data.tx_sent}</TableCell>
<TableCell align="right">{formatNumber(data.tx_sent)}</TableCell>
</TableRow>
<TableRow>
<TableCell >
(Tx) Send Errors
</TableCell>
<TableCell align="center">{data.tx_errors}</TableCell>
<TableCell align="right">{formatNumber(data.tx_errors)}</TableCell>
</TableRow>
</TableBody>
</Table>