Add a light-sensor demo to the Developer app

This commit is contained in:
James Babcock committed 2026-09-03 22:23:54 -07:00
1 parent aef6194687
commit c37a9eec45
9 files changed
+525 -20

No files matched your search

+9
View File
@@ -89,6 +89,15 @@ export function hasMicControl(info: FirmwareInfo): boolean {
return info.capabilities.trim().split(/\s+/).includes("micctl");
}
/**
* True when the firmware advertises the optional ambient-light extension:
* image-handler mode 16 (query / passive polling of the OPT3001 light sensor)
* with field-105 reports, used to drive a phone-side brightness policy.
*/
export function hasAmbientLightSensor(info: FirmwareInfo): boolean {
return info.capabilities.trim().split(/\s+/).includes("als16");
}
/** The higher of the two arms' reported versions, or "" if none reported. */
export function reportedFirmwareVersion(info: FirmwareInfo): string {
const versions = [info.leftVersion, info.rightVersion].map((v) => v.trim()).filter(Boolean);