refactor(display): improve touch handling and code formatting

This commit is contained in:
2026-02-17 03:10:52 -08:00
parent 2907dac33d
commit d61c9c60bf
5 changed files with 128 additions and 92 deletions

View File

@@ -258,3 +258,13 @@ void DoorbellLogic::onSerialCommand(const String& cmd) {
}
else Serial.println(F("[CMD] alert|silence|reboot|dashboard|off|status"));
}
void DoorbellLogic::setScreen(ScreenID s) {
Serial.printf("[SCREEN] Set to %s\n", screenIdStr(s));
_state.screen = s;
// Auto-manage backlight based on screen
bool needsBacklight = (s != ScreenID::OFF);
_display->setBacklight(needsBacklight);
_state.backlightOn = needsBacklight;
}

View File

@@ -34,6 +34,7 @@ private:
void flushStatus(const String& message);
void heartbeat();
void transition(DeviceState s);
void setScreen(ScreenID s);
String topicUrl(const char* base);
DisplayManager* _display;