mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
show not available when a dallas sensor is offline
This commit is contained in:
@@ -70,6 +70,13 @@ type EMSESPDevicesFormProps = RestFormProps<EMSESPDevices> &
|
||||
AuthenticatedContextProps &
|
||||
WithWidthProps;
|
||||
|
||||
function formatTemp(t: string) {
|
||||
if (t == null) {
|
||||
return "(not available)";
|
||||
}
|
||||
return t + " °C";
|
||||
}
|
||||
|
||||
class EMSESPDevicesForm extends Component<
|
||||
EMSESPDevicesFormProps,
|
||||
EMSESPDevicesFormState
|
||||
@@ -194,7 +201,7 @@ class EMSESPDevicesForm extends Component<
|
||||
{sensorData.id}
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
{sensorData.temp} °C
|
||||
{formatTemp(sensorData.temp)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user