forked from Blendman974/faceclaw
Watch display shows if glasses are charging or silent mode
This commit is contained in:
1 parent
ed8302bc6b
commit
6cd7d5fff9
10 files changed
+122
-20
No files matched your search
@@ -0,0 +1,29 @@
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert/strict");
|
||||
|
||||
const { chargingDisplayLabel, glassesDisplayLabel } = require("../.test-build/app/g2/glasses-display-state.js");
|
||||
|
||||
const connected = {
|
||||
phase: "connected",
|
||||
silentMode: false,
|
||||
screenOn: true,
|
||||
battery: 72,
|
||||
foregroundTitle: "Music",
|
||||
};
|
||||
|
||||
test("the foreground-title line covers visible, dark, and silent displays", () => {
|
||||
assert.equal(glassesDisplayLabel(connected), "Music");
|
||||
assert.equal(glassesDisplayLabel({ ...connected, foregroundTitle: null }), "Launcher");
|
||||
assert.equal(glassesDisplayLabel({ ...connected, screenOn: false }), "Display off");
|
||||
assert.equal(glassesDisplayLabel({ ...connected, screenOn: false, silentMode: true }), "Silent mode");
|
||||
});
|
||||
|
||||
test("charging takes precedence and includes the last-known G2 battery", () => {
|
||||
assert.equal(
|
||||
glassesDisplayLabel({ ...connected, phase: "charging", silentMode: true, screenOn: false }),
|
||||
"Charging · G2 72%",
|
||||
);
|
||||
assert.equal(chargingDisplayLabel(null), "Charging");
|
||||
assert.equal(chargingDisplayLabel(-1), "Charging");
|
||||
assert.equal(chargingDisplayLabel(101), "Charging");
|
||||
});
|
||||
@@ -15,6 +15,7 @@
|
||||
"../app/g2/ble-proximity.ts",
|
||||
"../app/g2/even-advertisement.ts",
|
||||
"../app/g2/glasses-artwork.ts",
|
||||
"../app/g2/glasses-display-state.ts",
|
||||
"../app/g2/pairing-candidates.ts"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user