From 48fd2412e8eb07c02a226935557828e37400d02c Mon Sep 17 00:00:00 2001 From: mitte2 Date: Thu, 14 May 2026 17:47:52 +0200 Subject: [PATCH 1/2] current sensor unit fix wrong unit in lpp sensors, add convertion between A and mA --- frontend/src/components/repeater/repeaterPaneShared.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/repeater/repeaterPaneShared.tsx b/frontend/src/components/repeater/repeaterPaneShared.tsx index 5ec04d4..b7a8591 100644 --- a/frontend/src/components/repeater/repeaterPaneShared.tsx +++ b/frontend/src/components/repeater/repeaterPaneShared.tsx @@ -212,7 +212,7 @@ export const LPP_UNIT_MAP: Record = { humidity: '%', barometer: 'hPa', voltage: 'V', - current: 'mA', + current: 'A', luminosity: 'lux', altitude: 'm', power: 'W', @@ -235,6 +235,10 @@ export function lppDisplayUnit( if (typeName === 'temperature' && unitPref === 'imperial') { return { unit: '°F', value: (value * 9) / 5 + 32 }; } + if (typeName === 'current') { + if (value <= 1) + return { unit: 'mA', value: value * 1000 }; + } return { unit: LPP_UNIT_MAP[typeName] ?? '', value }; } From f3e9953b48ff1941268bd4c3f8a425f056f1a5ee Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Thu, 14 May 2026 08:58:18 -0700 Subject: [PATCH 2/2] Fix linting --- frontend/src/components/repeater/repeaterPaneShared.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/components/repeater/repeaterPaneShared.tsx b/frontend/src/components/repeater/repeaterPaneShared.tsx index b7a8591..5dc31c3 100644 --- a/frontend/src/components/repeater/repeaterPaneShared.tsx +++ b/frontend/src/components/repeater/repeaterPaneShared.tsx @@ -236,8 +236,7 @@ export function lppDisplayUnit( return { unit: '°F', value: (value * 9) / 5 + 32 }; } if (typeName === 'current') { - if (value <= 1) - return { unit: 'mA', value: value * 1000 }; + if (value <= 1) return { unit: 'mA', value: value * 1000 }; } return { unit: LPP_UNIT_MAP[typeName] ?? '', value }; }