v3 M1c (firmware): Provider screen — active source + tap-to-switch
New SCREEN_PROVIDER (Menu → "Provider"): shows the active provider's brand name
in the accent colour (recolors live on a theme switch via the shared accent
style) and its "i / c" position among the enabled providers. A Switch button
notifies {"cmd":"provnext"}; the daemon owns the enabled set/order and cycles to
the next one, so the watch stays dumb. When only one provider is enabled the
button is replaced by a hint.
main.cpp parses the optional pnm/pi/pc payload fields into ui_set_provider_badge.
Builds green on all four boards (206/216/18/216_c6); verified on 2.06 hardware
(OpenAI green theme + "2 / 3" + Switch).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -173,6 +173,13 @@ static bool parse_json(const char* json, UsageData* out) {
|
||||
const char* pv = doc["pv"] | (const char*)nullptr;
|
||||
uint32_t ac = doc["ac"] | 0u;
|
||||
if (pv != nullptr || ac != 0u) ui_set_theme(pv, ac);
|
||||
|
||||
// v3 Provider screen badge — optional "pnm" (name) + "pi"/"pc" (1-based
|
||||
// position / count among enabled providers). Present on the ~60s heartbeat.
|
||||
const char* pnm = doc["pnm"] | (const char*)nullptr;
|
||||
int pi = doc["pi"] | 0;
|
||||
int pc = doc["pc"] | 0;
|
||||
if (pnm != nullptr || pc != 0) ui_set_provider_badge(pnm, pi, pc);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user