File tree 1 file changed +5
-5
lines changed
libraries/Matter/examples/MatterOnOffLight
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 22
22
MatterOnOffLight OnOffLight;
23
23
24
24
// 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" ;
27
27
28
28
// set your board LED pin here
29
29
#ifdef LED_BUILTIN
@@ -49,7 +49,7 @@ bool setLightOnOff(bool state) {
49
49
digitalWrite (ledPin, LOW);
50
50
}
51
51
// store last OnOff state for when the Light is restarted / power goes off
52
- statePref .putBool (OnOffPrefKey , state);
52
+ matterPref .putBool (onOffPrefKey , state);
53
53
// This callback must return the success state to Matter core
54
54
return true ;
55
55
}
@@ -83,8 +83,8 @@ void setup() {
83
83
delay (500 );
84
84
85
85
// 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 );
88
88
OnOffLight.begin (lastOnOffState);
89
89
OnOffLight.onChange (setLightOnOff);
90
90
You can’t perform that action at this time.
0 commit comments