feat: add unread message count field to clock dashboard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-14 18:20:49 +02:00
parent 9426c86e79
commit 1fcad7776a
2 changed files with 7 additions and 2 deletions

View File

@@ -13,7 +13,8 @@ static const uint8_t DASH_ALT = 6;
static const uint8_t DASH_LUX = 7;
static const uint8_t DASH_CO2 = 8;
static const uint8_t DASH_NODES = 9;
static const uint8_t DASH_COUNT = 10;
static const uint8_t DASH_MSGS = 10;
static const uint8_t DASH_COUNT = 11;
class DashboardConfigScreen : public UIScreen {
UITask* _task;
@@ -84,5 +85,5 @@ public:
const char* DashboardConfigScreen::OPTION_NAMES[DASH_COUNT] = {
"None", "Battery", "Temp", "Humidity", "Pressure",
"GPS", "Altitude", "Lux", "CO2", "Contacts"
"GPS", "Altitude", "Lux", "CO2", "Contacts", "Messages"
};

View File

@@ -1904,6 +1904,10 @@ public:
} else if (field == DASH_NODES) {
strcpy(label, "Nodes");
snprintf(val, sizeof(val), "%d", the_mesh.getNumContacts());
} else if (field == DASH_MSGS) {
strcpy(label, "Msgs");
int unread = _task->getDMUnreadTotal() + _task->getChannelUnreadCount() + _task->getRoomUnreadCount();
snprintf(val, sizeof(val), "%d", unread);
} else {
uint8_t lpp_type = 0;
switch (field) {