forked from Blendman974/faceclaw
Merge main into ios-port and update the iOS CFW transport
This commit is contained in:
commit
e8e144f3f2
156 files changed
+10528
-1679
No files matched your search
@@ -25,7 +25,9 @@ export type NightscoutSettings = {
|
||||
siteUrl: string;
|
||||
apiToken: string;
|
||||
};
|
||||
export type BatteryDisplayMode = "icon" | "percentage";
|
||||
export type BatteryDisplayMode = "icon" | "percentage" | "stacked" | "stacked-percentage";
|
||||
/** When a top-bar battery indicator is shown: always, only below 50%, or never. */
|
||||
export type BatteryIndicatorVisibility = "always" | "low" | "never";
|
||||
export type TimeFormat = "24h" | "12h";
|
||||
export type ScreenTimeoutSetting = "15s" | "30s" | "1m" | "3m" | "never";
|
||||
// "auto" lets the glasses' ambient-light sensor drive brightness; the numeric
|
||||
@@ -211,14 +213,68 @@ export class ConfigSettingString<TId extends string = string> extends ConfigSett
|
||||
|
||||
export const batteryDisplayModeSetting = new ConfigSettingEnum<BatteryDisplayMode>({
|
||||
id: "batteryDisplayMode",
|
||||
label: "Battery display",
|
||||
label: "Style",
|
||||
storageKey: "dashboard.systemCard.batteryDisplayMode",
|
||||
defaultValue: "icon",
|
||||
values: ["icon", "percentage"],
|
||||
defaultValue: "stacked",
|
||||
values: ["icon", "percentage", "stacked", "stacked-percentage"],
|
||||
formatValue: batteryDisplayModeLabel,
|
||||
description: "How the top bar shows the phone and glasses battery levels: a small gauge icon or an exact percentage.",
|
||||
description: "How the top bar shows battery levels: a gauge icon or exact percentage beside the label, or a compact gauge or percentage with the label stacked above it.",
|
||||
});
|
||||
|
||||
/** Below this charge level a "Below 50%" indicator becomes visible. */
|
||||
export const BATTERY_LOW_VISIBILITY_THRESHOLD = 50;
|
||||
|
||||
function batteryVisibilitySetting(
|
||||
id: string,
|
||||
device: string,
|
||||
storageKey: string,
|
||||
): ConfigSettingEnum<BatteryIndicatorVisibility> {
|
||||
return new ConfigSettingEnum<BatteryIndicatorVisibility>({
|
||||
id,
|
||||
label: device,
|
||||
storageKey,
|
||||
defaultValue: "always",
|
||||
values: ["always", "low", "never"],
|
||||
formatValue: batteryIndicatorVisibilityLabel,
|
||||
description: `When the top bar shows the ${device} battery: always, only once it drops below ${BATTERY_LOW_VISIBILITY_THRESHOLD}%, or never.`,
|
||||
});
|
||||
}
|
||||
|
||||
export const phoneBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
"phoneBatteryVisibility", "Phone", "display.battery.phoneVisibility",
|
||||
);
|
||||
export const glassesBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
"glassesBatteryVisibility", "G2", "display.battery.glassesVisibility",
|
||||
);
|
||||
export const ringBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
"ringBatteryVisibility", "R1", "display.battery.ringVisibility",
|
||||
);
|
||||
/** The Wear OS watch; the indicator only exists while a watch is reachable. */
|
||||
export const watchBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
"watchBatteryVisibility", "Watch", "display.battery.watchVisibility",
|
||||
);
|
||||
|
||||
/** Whether an indicator with this visibility setting shows at the given charge. */
|
||||
export function batteryIndicatorVisible(visibility: BatteryIndicatorVisibility, percent: number): boolean {
|
||||
if (visibility === "never") return false;
|
||||
if (visibility === "always") return true;
|
||||
return percent < BATTERY_LOW_VISIBILITY_THRESHOLD;
|
||||
}
|
||||
|
||||
/**
|
||||
* One string summarizing every setting the top-bar battery block reads, so
|
||||
* the shell can cheaply tell whether a settings change needs a repaint.
|
||||
*/
|
||||
export function batteryIndicatorSettingsKey(): string {
|
||||
return [
|
||||
batteryDisplayModeSetting.get(),
|
||||
phoneBatteryVisibilitySetting.get(),
|
||||
glassesBatteryVisibilitySetting.get(),
|
||||
ringBatteryVisibilitySetting.get(),
|
||||
watchBatteryVisibilitySetting.get(),
|
||||
].join("|");
|
||||
}
|
||||
|
||||
export const timeFormatSetting = new ConfigSettingEnum<TimeFormat>({
|
||||
id: "timeFormat",
|
||||
label: "Time format",
|
||||
@@ -447,7 +503,7 @@ export const useMicControlSetting = new ConfigSettingBoolean({
|
||||
storageKey: "developer.useMicControl",
|
||||
defaultValue: true,
|
||||
description:
|
||||
"Use the custom firmware's per-temple mic-control channel (caps token micctl) for the Microphones app's array capture. When off, behave as if the firmware doesn't have the feature and use the standard single mixed stream.",
|
||||
"Use the custom firmware's per-temple mic-control channel for the Microphones app's array capture. When off, use the standard single mixed stream.",
|
||||
});
|
||||
|
||||
export const showBleBandwidthSetting = new ConfigSettingBoolean({
|
||||
@@ -472,12 +528,19 @@ export const ringConnectionModeSetting = new ConfigSettingEnum<RingConnectionMod
|
||||
"How R1 ring input reaches the phone. Only via glasses: the ring's own link to the glasses carries its gestures, and the phone never opens a Bluetooth connection to the ring. Direct: also connect to the ring from the phone (currently unreliable). Takes effect on the next connection to the glasses.",
|
||||
});
|
||||
|
||||
export type VoiceProvider = "onboard" | "elevenlabs" | "whisper" | "soniox";
|
||||
// "whisper" (no "onboard-" prefix) is OpenAI's CLOUD realtime model
|
||||
// (gpt-realtime-whisper); "onboard-whisper" is the on-device sherpa-onnx
|
||||
// Whisper backend. Same underlying model family, two different places it
|
||||
// runs -- see the same note in native/voice-control.ts. The "whisper" value
|
||||
// keeps its name (it's a persisted setting on real installs) but its label
|
||||
// below now says "OpenAI" to tell the two apart in the picker.
|
||||
export type VoiceProvider = "onboard" | "onboard-whisper" | "elevenlabs" | "whisper" | "soniox";
|
||||
|
||||
const voiceProviderLabels: Record<VoiceProvider, string> = {
|
||||
onboard: "On-device",
|
||||
onboard: "On-device (Moonshine)",
|
||||
"onboard-whisper": "On-device (Whisper)",
|
||||
elevenlabs: "ElevenLabs",
|
||||
whisper: "Whisper",
|
||||
whisper: "OpenAI (Whisper)",
|
||||
soniox: "Soniox",
|
||||
};
|
||||
|
||||
@@ -486,7 +549,7 @@ export const voiceProviderSetting = new ConfigSettingEnum<VoiceProvider>({
|
||||
label: "Transcription Provider",
|
||||
storageKey: "voice.provider",
|
||||
defaultValue: "onboard",
|
||||
values: ["onboard", "elevenlabs", "whisper", "soniox"],
|
||||
values: ["onboard", "onboard-whisper", "elevenlabs", "whisper", "soniox"],
|
||||
formatValue: (value) => voiceProviderLabels[value] ?? value,
|
||||
isDisabled: (value) => {
|
||||
if (value === "elevenlabs") return elevenLabsApiKeySetting.get().trim().length === 0;
|
||||
@@ -494,7 +557,7 @@ export const voiceProviderSetting = new ConfigSettingEnum<VoiceProvider>({
|
||||
if (value === "soniox") return sonioxApiKeySetting.get().trim().length === 0;
|
||||
return false;
|
||||
},
|
||||
description: "Speech-to-text engine for voice input. ElevenLabs, Whisper, and Soniox are cloud services that need an API key, with significantly better accuracy than on-device transcription. On-device transcription needs the voice model downloaded (below).",
|
||||
description: "Speech-to-text engine for voice input. ElevenLabs, OpenAI, and Soniox are cloud services that need an API key, with significantly better accuracy than on-device transcription. The two On-device options need their voice model downloaded (below) and never leave the phone.",
|
||||
});
|
||||
|
||||
const wakeWordActionLabels: Record<WakeWordAction, string> = {
|
||||
@@ -934,7 +997,16 @@ export function screenTimeoutLabel(value: ScreenTimeoutSetting): string {
|
||||
}
|
||||
|
||||
export function batteryDisplayModeLabel(value: BatteryDisplayMode): string {
|
||||
return value === "icon" ? "Icon" : "Percentage";
|
||||
if (value === "percentage") return "Percentage";
|
||||
if (value === "stacked") return "Stacked";
|
||||
if (value === "stacked-percentage") return "Stacked percentage";
|
||||
return "Icon";
|
||||
}
|
||||
|
||||
export function batteryIndicatorVisibilityLabel(value: BatteryIndicatorVisibility): string {
|
||||
if (value === "never") return "Never";
|
||||
if (value === "low") return `Below ${BATTERY_LOW_VISIBILITY_THRESHOLD}%`;
|
||||
return "Always";
|
||||
}
|
||||
|
||||
export function timeFormatLabel(value: TimeFormat): string {
|
||||
|
||||
Reference in new issue
Block a user