minor changes to error messages

This commit is contained in:
proddy
2020-07-08 19:15:12 +02:00
parent ca130576fd
commit 1477e816e7
3 changed files with 40 additions and 38 deletions

View File

@@ -73,6 +73,7 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
const { width, data } = this.props; const { width, data } = this.props;
return ( return (
<TableContainer> <TableContainer>
{!this.noData() && (
<Table size="small" padding={isWidthDown('xs', width!) ? "none" : "default"}> <Table size="small" padding={isWidthDown('xs', width!) ? "none" : "default"}>
<TableHead> <TableHead>
<TableRow> <TableRow>
@@ -109,11 +110,12 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
))} ))}
</TableBody> </TableBody>
</Table> </Table>
)}
{this.noData() && {this.noData() &&
( (
<Box bgcolor="error.main" color="error.contrastText" p={2} mt={2} mb={2}> <Box bgcolor="error.main" color="error.contrastText" p={2} mt={2} mb={2}>
<Typography variant="body1"> <Typography variant="body1">
No EMS devices found. No EMS devices found. Check connection and for Tx errors. Try forcing a scan.
</Typography> </Typography>
</Box> </Box>
) )

View File

@@ -22,7 +22,7 @@ export const busStatus = ({ status }: EMSESPStatus) => {
case busConnectionStatus.BUS_STATUS_CONNECTED: case busConnectionStatus.BUS_STATUS_CONNECTED:
return "Connected"; return "Connected";
case busConnectionStatus.BUS_STATUS_TX_ERRORS: case busConnectionStatus.BUS_STATUS_TX_ERRORS:
return "Tx not stable"; return "Tx Errors";
case busConnectionStatus.BUS_STATUS_OFFLINE: case busConnectionStatus.BUS_STATUS_OFFLINE:
return "Disconnected"; return "Disconnected";
default: default:

View File

@@ -139,7 +139,7 @@ uint8_t EMSESP::bus_status() {
} }
// Tx Failure rate > 5% // Tx Failure rate > 5%
if (((txservice_.telegram_fail_count() * 100) / total_sent) >= 5) { if (((txservice_.telegram_fail_count() * 100) / total_sent) > 5) {
return BUS_STATUS_TX_ERRORS; return BUS_STATUS_TX_ERRORS;
} }