Skip to content

Commit 7442623

Browse files
committed
fix(matter): fixes window blind terms in code and readme file
1 parent 1a501ed commit 7442623

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

libraries/Matter/examples/MatterSimpleBlinds/MatterSimpleBlinds.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Matter Simple Blind Example
15+
// Matter Simple Blinds Example
1616
// This is a minimal example that only controls Lift percentage using a single onGoToLiftPercentage() callback
1717

1818
#include <Matter.h>
@@ -33,7 +33,7 @@ const char *password = "your-password"; // Change this to your WiFi password
3333
#endif
3434

3535
// Simple callback - handles window Lift change request
36-
bool onBlindLift(uint8_t liftPercent) {
36+
bool onBlindsLift(uint8_t liftPercent) {
3737
// This example only uses lift
3838
Serial.printf("Window Covering change request: Lift=%d%%\r\n", liftPercent);
3939

@@ -44,9 +44,9 @@ bool onBlindLift(uint8_t liftPercent) {
4444
void setup() {
4545
Serial.begin(115200);
4646
delay(1000);
47-
Serial.println("\n========================================");
47+
Serial.println("\n============================");
4848
Serial.println("Matter Simple Blinds Example");
49-
Serial.println("========================================\n");
49+
Serial.println("============================\n");
5050

5151
// CONFIG_ENABLE_CHIPOBLE is enabled when BLE is used to commission the Matter Network
5252
#if !CONFIG_ENABLE_CHIPOBLE
@@ -70,7 +70,7 @@ void setup() {
7070
WindowBlinds.begin(100, 0, MatterWindowCovering::ROLLERSHADE);
7171

7272
// Set up the onGoToLiftPercentage callback - this handles all window covering changes requested by the Matter Controller
73-
WindowBlinds.onGoToLiftPercentage(onBlindLift);
73+
WindowBlinds.onGoToLiftPercentage(onBlindsLift);
7474

7575
// Start Matter
7676
Matter.begin();

libraries/Matter/examples/MatterSimpleBlinds/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Before uploading the sketch, configure the following:
5555

5656
## Building and Flashing
5757

58-
1. Open the `MatterSimpleWindowBlind.ino` sketch in the Arduino IDE.
58+
1. Open the `MatterSimpleBlinds.ino` sketch in the Arduino IDE.
5959
2. Select your ESP32 board from the **Tools > Board** menu.
6060
3. Select **"Huge APP (3MB No OTA/1MB SPIFFS)"** from **Tools > Partition Scheme** menu.
6161
4. Enable **"Erase All Flash Before Sketch Upload"** option from **Tools** menu.
@@ -65,9 +65,9 @@ Before uploading the sketch, configure the following:
6565
## Expected Output
6666

6767
```
68-
========================================
68+
============================
6969
Matter Simple Blinds Example
70-
========================================
70+
============================
7171
7272
Connecting to your-ssid
7373
WiFi connected
@@ -96,18 +96,18 @@ Window Covering change request: Lift=50%
9696

9797
## Code Structure
9898

99-
- **`onBlindLift()`**: Callback function that handles window covering lift changes. This is registered with `WindowBlinds.onGoToLiftPercentage()` and is triggered when `TargetPositionLiftPercent100ths` changes. The callback receives the target lift percentage (0-100%).
99+
- **`onBlindsLift()`**: Callback function that handles window covering lift changes. This is registered with `WindowBlinds.onGoToLiftPercentage()` and is triggered when `TargetPositionLiftPercent100ths` changes. The callback receives the target lift percentage (0-100%).
100100
- **`setup()`**: Initializes Wi-Fi (if needed), Window Covering endpoint with `ROLLERSHADE` type, registers the callback, and starts Matter.
101101
- **`loop()`**: Empty - all control is handled via Matter callbacks.
102102

103103
## Customization
104104

105105
### Adding Motor Control
106106

107-
In the `onBlindLift()` callback, replace the simulation code with actual motor control:
107+
In the `onBlindsLift()` callback, replace the simulation code with actual motor control:
108108

109109
```cpp
110-
bool onBlindLift(uint8_t liftPercent) {
110+
bool onBlindsLift(uint8_t liftPercent) {
111111
Serial.printf("Moving window covering to %d%%\r\n", liftPercent);
112112

113113
// Here you would control your actual motor/actuator
@@ -131,7 +131,7 @@ bool onBlindLift(uint8_t liftPercent) {
131131
132132
3. **Commands not working**: Ensure the callback returns `true` to accept the command. If it returns `false`, the command will be rejected.
133133
134-
4. **Motor not responding**: Replace the simulation code in `onBlindLift()` with your actual motor control implementation. Remember to update `CurrentPosition` and set `OperationalState` to `STALL` when movement is complete.
134+
4. **Motor not responding**: Replace the simulation code in `onBlindsLift()` with your actual motor control implementation. Remember to update `CurrentPosition` and set `OperationalState` to `STALL` when movement is complete.
135135
136136
## Notes
137137

0 commit comments

Comments
 (0)