Add functionality to disable all LEDs
This commit is contained in:
parent
969d2137c3
commit
3e00f1b4a6
6 changed files with 15 additions and 7 deletions
|
@ -10,6 +10,11 @@ void ledTask(void *parameter) {
|
|||
if (ledTaskQueue != NULL) {
|
||||
if (xQueueReceive(ledTaskQueue, &ledTaskParams, portMAX_DELAY) ==
|
||||
pdPASS) {
|
||||
|
||||
if (preferences.getBool("disableLeds", false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t oldLights[NEOPIXEL_COUNT];
|
||||
|
||||
// get current state
|
||||
|
|
|
@ -34,7 +34,7 @@ void workerTask(void *pvParameters) {
|
|||
priceSymbol = '[';
|
||||
}
|
||||
if (getCurrentScreen() == SCREEN_BTC_TICKER) {
|
||||
taskEpdContent = parsePriceData(price, priceSymbol);
|
||||
taskEpdContent = parsePriceData(price, priceSymbol, preferences.getBool("suffixPrice", false));
|
||||
} else if (getCurrentScreen() == SCREEN_MSCW_TIME) {
|
||||
taskEpdContent = parseSatsPerCurrency(price, priceSymbol, preferences.getBool("useSatsSymbol", false));
|
||||
} else {
|
||||
|
|
|
@ -320,7 +320,8 @@ void onApiSettingsPatch(AsyncWebServerRequest *request, JsonVariant &json) {
|
|||
|
||||
String boolSettings[] = {"fetchEurPrice", "ledTestOnPower", "ledFlashOnUpd",
|
||||
"mdnsEnabled", "otaEnabled", "stealFocus",
|
||||
"mcapBigChar", "useSatsSymbol", "useBlkCountdown"};
|
||||
"mcapBigChar", "useSatsSymbol", "useBlkCountdown",
|
||||
"suffixPrice", "disableLeds"};
|
||||
|
||||
for (String setting : boolSettings) {
|
||||
if (settings.containsKey(setting)) {
|
||||
|
@ -409,6 +410,8 @@ void onApiSettingsGet(AsyncWebServerRequest *request) {
|
|||
root["fetchEurPrice"] = preferences.getBool("fetchEurPrice", false);
|
||||
root["useSatsSymbol"] = preferences.getBool("useSatsSymbol", false);
|
||||
root["useBlkCountdown"] = preferences.getBool("useBlkCountdown", false);
|
||||
root["suffixPrice"] = preferences.getBool("suffixPrice", false);
|
||||
root["disableLeds"] = preferences.getBool("disableLeds", false);
|
||||
|
||||
root["hostnamePrefix"] = preferences.getString("hostnamePrefix", "btclock");
|
||||
root["hostname"] = getMyHostname();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue