mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-10 01:39:54 +03:00
HP inputs #600, custom entity bool display
This commit is contained in:
@@ -226,13 +226,11 @@ const SettingsEntities: FC = () => {
|
||||
};
|
||||
|
||||
function formatValue(value: any, uom: number) {
|
||||
if (value === undefined) {
|
||||
return '';
|
||||
}
|
||||
if (uom === 0) {
|
||||
return new Intl.NumberFormat().format(value);
|
||||
}
|
||||
return new Intl.NumberFormat().format(value) + ' ' + DeviceValueUOM_s[uom];
|
||||
return value === undefined || uom === undefined
|
||||
? ''
|
||||
: typeof value === 'number'
|
||||
? new Intl.NumberFormat().format(value) + (uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom])
|
||||
: value;
|
||||
}
|
||||
|
||||
function showHex(value: string, digit: number) {
|
||||
|
||||
@@ -346,7 +346,7 @@ export interface EntityItem {
|
||||
factor: number;
|
||||
uom: number;
|
||||
val_type: number;
|
||||
value?: number;
|
||||
value?: any;
|
||||
o_name?: string;
|
||||
o_device_id?: string;
|
||||
o_type_id?: string;
|
||||
|
||||
Reference in New Issue
Block a user