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