Skip to content

Commit c9783d0

Browse files
committed
show voltage in less situations
1 parent d3eafb8 commit c9783d0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

gui/src/components/tracker/TrackerBattery.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function TrackerBattery({
88
voltage,
99
runtime,
1010
disabled,
11+
moreInfo = false,
1112
textColor = 'primary',
1213
}: {
1314
/**
@@ -17,6 +18,7 @@ export function TrackerBattery({
1718
voltage?: number | null;
1819
runtime?: bigint | null;
1920
disabled?: boolean;
21+
moreInfo?: boolean;
2022
textColor?: string;
2123
}) {
2224
const { currentLocales } = useLocaleConfig();
@@ -30,7 +32,8 @@ export function TrackerBattery({
3032
});
3133

3234
const charging = (voltage || 0) > 4.3;
33-
const showVoltage = voltage && config?.debug;
35+
const debug = config?.debug || config?.devSettings.moreInfo;
36+
const showVoltage = moreInfo && voltage && debug;
3437

3538
return (
3639
<div className="flex gap-2">
@@ -47,7 +50,7 @@ export function TrackerBattery({
4750
'min'}
4851
</Typography>
4952
)}
50-
{!charging && (!runtime || showVoltage) && (
53+
{!charging && (!runtime || debug) && (
5154
<Typography color={textColor}>
5255
{percentFormatter.format(value)}
5356
</Typography>

gui/src/components/tracker/TrackerCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function TrackerBig({
5353
value={device.hardwareStatus.batteryPctEstimate / 100}
5454
runtime={device.hardwareStatus.batteryRuntimeEstimate}
5555
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
56+
moreInfo={true}
5657
/>
5758
)}
5859
<div className="flex gap-2">

gui/src/components/tracker/TrackersTable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ function Row({
231231
voltage={device.hardwareStatus.batteryVoltage}
232232
runtime={device.hardwareStatus.batteryRuntimeEstimate}
233233
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
234+
moreInfo={config?.devSettings.moreInfo}
234235
textColor={fontColor}
235236
/>
236237
)}

0 commit comments

Comments
 (0)