feat: add state change events and callbacks (#798)

This commit is contained in:
laride
2025-07-18 01:35:31 +08:00
committed by GitHub
parent c68c959e9b
commit 5c8707075f
7 changed files with 109 additions and 14 deletions

View File

@@ -990,6 +990,9 @@ void Application::SetDeviceState(DeviceState state) {
// The state is changed, wait for all background tasks to finish
background_task_->WaitForCompletion();
// Send the state change event
DeviceStateEventManager::GetInstance().PostStateChangeEvent(previous_state, state);
auto& board = Board::GetInstance();
auto display = board.GetDisplay();
auto led = board.GetLed();