Skip to content

Commit

Permalink
feat: Add defines for preferences key
Browse files Browse the repository at this point in the history
  • Loading branch information
jniebuhr committed Nov 8, 2024
1 parent 102add6 commit b191316
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/display/core/Settings.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Settings.h"

Settings::Settings() {
preferences.begin("controller", true);
preferences.begin(PREFERENCES_KEY, true);
startupMode = preferences.getInt("sm", MODE_STANDBY);
targetBrewTemp = preferences.getInt("tb", 90);
targetSteamTemp = preferences.getInt("ts", 145);
Expand All @@ -24,7 +24,7 @@ void Settings::batchUpdate(const SettingsCallback &callback) {
void Settings::save() {
if (inBatch)
return;
preferences.begin("controller", false);
preferences.begin(PREFERENCES_KEY, false);
preferences.putInt("sm", startupMode);
preferences.putInt("tb", targetBrewTemp);
preferences.putInt("ts", targetSteamTemp);
Expand Down
2 changes: 2 additions & 0 deletions src/display/core/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <Arduino.h>
#include <Preferences.h>

#define PREFERENCES_KEY "controller"

class Settings;
using SettingsCallback = std::function<void(Settings *)>;

Expand Down

0 comments on commit b191316

Please sign in to comment.