fix missing values (bool/enum/string) in dashboard

This commit is contained in:
MichaelDvP
2024-04-23 15:26:38 +02:00
parent 28347fd0a4
commit 85492781bc

View File

@@ -31,7 +31,7 @@ export function formatValue(
uom: DeviceValueUOM uom: DeviceValueUOM
) { ) {
if (typeof value !== 'number') { if (typeof value !== 'number') {
return ''; return value;
} }
switch (uom) { switch (uom) {
case DeviceValueUOM.HOURS: case DeviceValueUOM.HOURS:
@@ -41,10 +41,7 @@ export function formatValue(
case DeviceValueUOM.SECONDS: case DeviceValueUOM.SECONDS:
return LL.NUM_SECONDS({ num: value }); return LL.NUM_SECONDS({ num: value });
case DeviceValueUOM.NONE: case DeviceValueUOM.NONE:
if (typeof value === 'number') { return new Intl.NumberFormat().format(value);
return new Intl.NumberFormat().format(value);
}
return value;
case DeviceValueUOM.DEGREES: case DeviceValueUOM.DEGREES:
case DeviceValueUOM.DEGREES_R: case DeviceValueUOM.DEGREES_R:
case DeviceValueUOM.FAHRENHEIT: case DeviceValueUOM.FAHRENHEIT: