Fix logic in Screen::shouldWakeOnReceivedMessage and add CLIENT_HIDDEN and CLIENT_BASE to be treated the same as CLIENT and CLIENT_MUTE

This commit is contained in:
Mike Robbins 2025-09-08 11:34:29 -07:00
parent 527e88ca46
commit 87eff2c4a9

View File

@ -1605,13 +1605,15 @@ bool shouldWakeOnReceivedMessage()
/*
The goal here is to determine when we do NOT wake up the screen on message received:
- Any ext. notifications are turned on
- If role is not client / client_mute
- If role is not CLIENT / CLIENT_MUTE / CLIENT_HIDDEN / CLIENT_BASE
- If the battery level is very low
*/
if (moduleConfig.external_notification.enabled) {
return false;
}
if (!meshtastic_Config_DeviceConfig_Role_CLIENT && !meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE) {
if (!IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_CLIENT,
meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE, meshtastic_Config_DeviceConfig_Role_CLIENT_HIDDEN,
meshtastic_Config_DeviceConfig_Role_CLIENT_BASE)) {
return false;
}
if (powerStatus && powerStatus->getBatteryChargePercent() < 10) {