Skip to content

Commit 79ba93c

Browse files
authored
feat(matter_example): change Preferences names
1 parent ab2f01c commit 79ba93c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: libraries/Matter/examples/MatterOnOffLight/MatterOnOffLight.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
MatterOnOffLight OnOffLight;
2323

2424
// it will keep last OnOff state stored, using Preferences
25-
Preferences statePref;
26-
const char *OnOffPrefKey = "OnOffState";
25+
Preferences matterPref;
26+
const char *onOffPrefKey = "OnOffState";
2727

2828
// set your board LED pin here
2929
#ifdef LED_BUILTIN
@@ -49,7 +49,7 @@ bool setLightOnOff(bool state) {
4949
digitalWrite(ledPin, LOW);
5050
}
5151
// store last OnOff state for when the Light is restarted / power goes off
52-
statePref.putBool(OnOffPrefKey, state);
52+
matterPref.putBool(onOffPrefKey, state);
5353
// This callback must return the success state to Matter core
5454
return true;
5555
}
@@ -83,8 +83,8 @@ void setup() {
8383
delay(500);
8484

8585
// Initialize Matter EndPoint
86-
statePref.begin("matterLight", false);
87-
bool lastOnOffState = statePref.getBool(OnOffPrefKey, true);
86+
matterPref.begin("MatterPrefs", false);
87+
bool lastOnOffState = matterPref.getBool(onOffPrefKey, true);
8888
OnOffLight.begin(lastOnOffState);
8989
OnOffLight.onChange(setLightOnOff);
9090

0 commit comments

Comments
 (0)