forked from Blendman974/faceclaw
EvenHub extensions: Fonts, window icons, touch-start events
This commit is contained in:
1 parent
4ee0af86cc
commit
84baee9c76
25 files changed
+1884
-127
No files matched your search
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* The live data behind an EvenHub app's device status: glasses presence (fed
|
||||
* by the connection controller), the headset battery (from the shell's top
|
||||
* bar state), and the paired glasses' serial.
|
||||
*/
|
||||
import { shell } from "../../ui/shell/shell";
|
||||
import { getGlassesPresence, onGlassesPresenceChanged } from "../../g2/glasses-presence";
|
||||
import { loadPairedGlassesIdentity } from "../../g2/device-addresses";
|
||||
import { type EvenHubDeviceStatusSource } from "./device-status";
|
||||
|
||||
export const liveDeviceStatusSource: EvenHubDeviceStatusSource = {
|
||||
read: () => {
|
||||
const presence = getGlassesPresence();
|
||||
return {
|
||||
serial: loadPairedGlassesIdentity()?.serial ?? null,
|
||||
connected: presence.connected,
|
||||
worn: presence.worn,
|
||||
battery: shell.getBatteryLevels().headset,
|
||||
charging: presence.charging,
|
||||
};
|
||||
},
|
||||
subscribe: (listener) => {
|
||||
const offs = [onGlassesPresenceChanged(listener), shell.onBatteryLevelsChanged(listener)];
|
||||
return () => {
|
||||
for (const off of offs) off();
|
||||
};
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user