clock_info: add BLE icon

this allows a user to quickly toggle whether BLE is or/off
master
Rob Pilling 2025-05-03 22:18:14 +01:00
parent 04023e859b
commit 73d428109d
3 changed files with 25 additions and 1 deletions

View File

@ -14,3 +14,4 @@
0.13: Cache loaded ClockInfos so if we have clockInfoWidget and a clock, we don't load them twice (saves ~300ms) 0.13: Cache loaded ClockInfos so if we have clockInfoWidget and a clock, we don't load them twice (saves ~300ms)
0.14: Check for .clkinfocache and use that if exists (from boot 0.64) 0.14: Check for .clkinfocache and use that if exists (from boot 0.64)
0.15: Fix error when displaying a category with only one clockinfo (fix #3728) 0.15: Fix error when displaying a category with only one clockinfo (fix #3728)
0.16: Add BLE clkinfo entry

View File

@ -118,6 +118,29 @@ exports.load = function() {
} }
hrm = 0; hrm = 0;
}, },
},
{ name: "BLE",
hasRange: false,
isOn: () => {
const s = NRF.getSecurityStatus();
return s.advertising || s.connected;
},
get: function() {
return {
text: this.isOn() ? "On" : "Off",
img: atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA==")
};
},
run: function() {
if (this.isOn()) {
NRF.sleep();
} else {
NRF.wake();
Bluetooth.setConsole(1);
}
},
show: function(){},
hide: function(){},
} }
], ],
}]; }];

View File

@ -1,7 +1,7 @@
{ "id": "clock_info", { "id": "clock_info",
"name": "Clock Info Module", "name": "Clock Info Module",
"shortName": "Clock Info", "shortName": "Clock Info",
"version":"0.15", "version":"0.16",
"description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)", "description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)",
"icon": "app.png", "icon": "app.png",
"type": "module", "type": "module",