File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
libraries/Matter/examples/MatterOnOffLight Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 2222MatterOnOffLight 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
You can’t perform that action at this time.
0 commit comments