diff options
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/attributes/usePositionAttributes.js | 4 | ||||
-rw-r--r-- | modern/src/common/components/PositionValue.js | 4 | ||||
-rw-r--r-- | modern/src/common/util/formatter.js | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/modern/src/common/attributes/usePositionAttributes.js b/modern/src/common/attributes/usePositionAttributes.js index cc50911c..e08e91d5 100644 --- a/modern/src/common/attributes/usePositionAttributes.js +++ b/modern/src/common/attributes/usePositionAttributes.js @@ -104,6 +104,10 @@ export default (t) => useMemo(() => ({ name: t('positionRssi'), type: 'number', }, + coolantTemp: { + name: t('positionCoolantTemp'), + type: 'number', + }, gps: { name: t('positionGps'), type: 'number', diff --git a/modern/src/common/components/PositionValue.js b/modern/src/common/components/PositionValue.js index a6b38e31..132cd648 100644 --- a/modern/src/common/components/PositionValue.js +++ b/modern/src/common/components/PositionValue.js @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import { Link } from '@mui/material'; import { Link as RouterLink } from 'react-router-dom'; import { - formatAlarm, formatAltitude, formatBoolean, formatCoordinate, formatCourse, formatDistance, formatNumber, formatNumericHours, formatPercentage, formatSpeed, formatTime, + formatAlarm, formatAltitude, formatBoolean, formatCoordinate, formatCourse, formatDistance, formatNumber, formatNumericHours, formatPercentage, formatSpeed, formatTime, formatTemperature, } from '../util/formatter'; import { useAttributePreference, usePreference } from '../util/preferences'; import { useTranslation } from './LocalizationProvider'; @@ -45,6 +45,8 @@ const PositionValue = ({ position, property, attribute }) => { return formatAltitude(value, altitudeUnit, t); case 'batteryLevel': return value != null ? formatPercentage(value, t) : ''; + case 'coolantTemp': + return formatTemperature(value); case 'alarm': return formatAlarm(value, t); case 'odometer': diff --git a/modern/src/common/util/formatter.js b/modern/src/common/util/formatter.js index 56c02547..610b8dd0 100644 --- a/modern/src/common/util/formatter.js +++ b/modern/src/common/util/formatter.js @@ -17,6 +17,8 @@ export const formatNumber = (value, precision = 1) => Number(value.toFixed(preci export const formatPercentage = (value) => `${value}%`; +export const formatTemperature = (value) => `${value}°C`; + export const formatTime = (value, format, hours12) => { if (value) { const m = moment(value); |