Wire up bluetooth indicator

This commit is contained in:
2026-03-26 17:12:47 -04:00
parent 5d93928678
commit 9fcd671daa

View File

@@ -332,6 +332,13 @@ static void main_window_unload(Window *window) {
animation_destroy(s_head_out_template);
}
static void bluetooth_callback(bool connected) {
replace_gbitmap_color(GColorLightGray, GColorBlack, s_bt_icon, s_bt_layer);
if (!connected) {
replace_gbitmap_color(GColorBlack, GColorLightGray, s_bt_icon, s_bt_layer);
}
}
// DEBUG buttons
static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) {
Window *window = (Window *)context;
@@ -442,6 +449,9 @@ static void init() {
// show the Window on the watch, with animated=true
window_stack_push(s_main_window, true);
// register with ConnectionService (bluetooth status)
connection_service_subscribe((ConnectionHandlers){.pebble_app_connection_handler=bluetooth_callback});
// register with TickTimerService
tick_timer_service_subscribe(MINUTE_UNIT, minute_handler);