Glassly Miniapp SDK betaThe SDK is in beta, so its APIs may change before general availability.Developing on Mentra Live? We recommend using the
Glassly Bluetooth SDK.The developer tools are available in the Glassly App under Settings →
Miniapp Developer Settings.Share feedback with an in-app bug report, on
Discord, or by email at
[email protected].
session.lightSensor reads the ambient light sensor on the glasses. It needs
custom firmware: the G2 (Glassly CFW or upstream g2flash) or the MemoMind One
(Glassly CFW). Stock firmware and other glasses reject its control requests.
src/background/index.ts
stop() or the miniapp
closes.
Reading light
query() asks for the driver’s cached value without opening the sensor. The
answer arrives through onUpdate() with reason: "query" and may be stale.
start(options?) polls the sensor and, on the G2, pauses the stock automatic
brightness adjustments while polling. Calling it again re-applies new options.
stop() restores stock behavior without changing the brightness setting.
Each
LightSensorData has:
MemoMind One
The MemoMind One firmware buffers its light readings and the phone polls that buffer, never faster than every 500 ms, applyingminDelta and heartbeatMs
itself; a reading can trail the sensor by up to one poll. On Glassly CFW
revision 14 the glasses sample the sensor at intervalMs themselves; on
revisions 10 to 13 they only buffer the stock reader’s roughly once-a-second
samples, which stop while auto-brightness is off. Polling does not depend on the
miniapp display on these glasses.
Ownership
One miniapp controls the sensor at a time. Others can observe readings but cannot reconfigure or stop it; theirstart() and stop() reject with
INVALID_ARGUMENT. Closing the owning miniapp releases the sensor. A
session.navigation trip on the glasses
temporarily takes the sensor back and polling resumes afterward.
Polling is bound to the custom firmware’s display lease: opening a stock screen
on the glasses or letting the miniapp display go idle stops polling. Call
start() again when your content returns.
Successful delivery of a command is not proof of a fresh sample.
start()
rejects with INTERNAL when the firmware refuses or never acknowledges it, for
example on stock firmware or without an active miniapp display.
