FindMy: Save and load state from file

This commit is contained in:
Willy-JL
2024-03-08 21:35:59 +00:00
parent 7c48c6164a
commit 5d45d6abb8
6 changed files with 110 additions and 29 deletions

View File

@@ -25,6 +25,8 @@ bool findmy_scene_main_on_event(void* context, SceneManagerEvent event) {
findmy_toggle_beacon(app);
break;
case FindMyMainEventBackground:
app->state.beacon_active = true;
findmy_state_save(&app->state);
if(!furi_hal_bt_extra_beacon_is_active()) {
furi_check(furi_hal_bt_extra_beacon_start());
}
@@ -40,6 +42,8 @@ bool findmy_scene_main_on_event(void* context, SceneManagerEvent event) {
findmy_change_broadcast_interval(app, app->state.broadcast_interval - 1);
break;
case FindMyMainEventQuit:
app->state.beacon_active = false;
findmy_state_save(&app->state);
if(furi_hal_bt_extra_beacon_is_active()) {
furi_check(furi_hal_bt_extra_beacon_stop());
}