File tree Expand file tree Collapse file tree 4 files changed +3
-5
lines changed
libraries/Matter/examples Expand file tree Collapse file tree 4 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 1818
1919// List of Matter Endpoints for this Node
2020// On/Off Light Endpoint
21- #include < MatterEndpoints/MatterOnOffLight.h>
2221MatterOnOffLight OnOffLight;
2322
2423// WiFi is manually set and started
Original file line number Diff line number Diff line change 1818
1919// List of Matter Endpoints for this Node
2020// There will be 3 On/Off Light Endpoints in the same Node
21- #include < MatterEndpoints/MatterOnOffLight.h>
2221MatterOnOffLight OnOffLight1;
2322MatterOnOffLight OnOffLight2;
2423MatterOnOffLight OnOffLight3;
Original file line number Diff line number Diff line change 1919
2020// List of Matter Endpoints for this Node
2121// Dimmable Light Endpoint
22- #include < MatterEndpoints/MatterDimmableLight.h>
2322MatterDimmableLight DimmableLight;
2423
2524// it will keep last OnOff & Brightness state stored, using Preferences
@@ -88,8 +87,10 @@ void setup() {
8887
8988 // Initialize Matter EndPoint
9089 lastStatePref.begin (" matterLight" , false );
90+ // default OnOff state is ON if not stored before
9191 bool lastOnOffState = lastStatePref.getBool (" lastOnOffState" , true );
92- uint8_t lastBrightness = lastStatePref.getUChar (" lastBrightness" , 15 ); // default brightness = 12%
92+ // default brightness ~= 6% (15/255)
93+ uint8_t lastBrightness = lastStatePref.getUChar (" lastBrightness" , 15 );
9394 DimmableLight.begin (lastOnOffState, lastBrightness);
9495 // set the callback function to handle the Light state change
9596 DimmableLight.onChange (setLightState);
Original file line number Diff line number Diff line change 1919
2020// List of Matter Endpoints for this Node
2121// On/Off Light Endpoint
22- #include < MatterEndpoints/MatterOnOffLight.h>
2322MatterOnOffLight OnOffLight;
2423
2524// it will keep last OnOff state stored, using Preferences
You can’t perform that action at this time.
0 commit comments