Skip to content

Commit 7304cea

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 9168784 commit 7304cea

File tree

3 files changed

+231
-232
lines changed

3 files changed

+231
-232
lines changed
Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,92 @@
1-
// Copyright 2025 Espressif Systems (Shanghai) PTE LTD
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
14-
15-
// Matter Simple Window Blinds Example
16-
// This is a minimal example that only controls Lift percentage using a single onGoToLiftPercentage() callback
17-
18-
#include <Matter.h>
19-
#if !CONFIG_ENABLE_CHIPOBLE
20-
// if the device can be commissioned using BLE, WiFi is not used - save flash space
21-
#include <WiFi.h>
22-
#endif
23-
24-
// List of Matter Endpoints for this Node
25-
// Window Covering Endpoint
26-
MatterWindowCovering WindowBlinds;
27-
28-
// CONFIG_ENABLE_CHIPOBLE is enabled when BLE is used to commission the Matter Network
29-
#if !CONFIG_ENABLE_CHIPOBLE
30-
// WiFi is manually set and started
31-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
32-
const char *password = "your-password"; // Change this to your WiFi password
33-
#endif
34-
35-
// Simple callback - handles window Lift change request
36-
bool onBlindLift(uint8_t liftPercent) {
37-
// This example only uses lift
38-
Serial.printf("Window Covering change request: Lift=%d%%\r\n", liftPercent);
39-
40-
// Returning true will store the new Lift value into the Matter Cluster
41-
return true;
42-
}
43-
44-
void setup() {
45-
Serial.begin(115200);
46-
delay(1000);
47-
Serial.println("\n========================================");
48-
Serial.println("Matter Simple Window Blinds Example");
49-
Serial.println("========================================\n");
50-
51-
// CONFIG_ENABLE_CHIPOBLE is enabled when BLE is used to commission the Matter Network
52-
#if !CONFIG_ENABLE_CHIPOBLE
53-
// We start by connecting to a WiFi network
54-
Serial.print("Connecting to ");
55-
Serial.println(ssid);
56-
WiFi.mode(WIFI_STA);
57-
WiFi.begin(ssid, password);
58-
while (WiFi.status() != WL_CONNECTED) {
59-
delay(500);
60-
Serial.print(".");
61-
}
62-
Serial.println("");
63-
Serial.println("WiFi connected");
64-
Serial.print("IP address: ");
65-
Serial.println(WiFi.localIP());
66-
#endif
67-
68-
// Initialize Window Covering endpoint
69-
// Using ROLLERSHADE type (lift only, no tilt)
70-
WindowBlinds.begin(100, 0, MatterWindowCovering::ROLLERSHADE);
71-
72-
// Set up the onGoToLiftPercentage callback - this handles all window covering changes requested by the Matter Controller
73-
WindowBlinds.onGoToLiftPercentage(onBlindLift);
74-
75-
// Start Matter
76-
Matter.begin();
77-
Serial.println("Matter started");
78-
Serial.println();
79-
80-
// Print commissioning information
81-
Serial.println("========================================");
82-
Serial.println("Matter Node is not commissioned yet.");
83-
Serial.println("Initiate the device discovery in your Matter environment.");
84-
Serial.println("Commission it to your Matter hub with the manual pairing code or QR code");
85-
Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str());
86-
Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str());
87-
Serial.println("========================================");
88-
}
89-
90-
void loop() {
91-
delay(100);
92-
}
1+
// Copyright 2025 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Matter Simple Window Blinds Example
16+
// This is a minimal example that only controls Lift percentage using a single onGoToLiftPercentage() callback
17+
18+
#include <Matter.h>
19+
#if !CONFIG_ENABLE_CHIPOBLE
20+
// if the device can be commissioned using BLE, WiFi is not used - save flash space
21+
#include <WiFi.h>
22+
#endif
23+
24+
// List of Matter Endpoints for this Node
25+
// Window Covering Endpoint
26+
MatterWindowCovering WindowBlinds;
27+
28+
// CONFIG_ENABLE_CHIPOBLE is enabled when BLE is used to commission the Matter Network
29+
#if !CONFIG_ENABLE_CHIPOBLE
30+
// WiFi is manually set and started
31+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
32+
const char *password = "your-password"; // Change this to your WiFi password
33+
#endif
34+
35+
// Simple callback - handles window Lift change request
36+
bool onBlindLift(uint8_t liftPercent) {
37+
// This example only uses lift
38+
Serial.printf("Window Covering change request: Lift=%d%%\r\n", liftPercent);
39+
40+
// Returning true will store the new Lift value into the Matter Cluster
41+
return true;
42+
}
43+
44+
void setup() {
45+
Serial.begin(115200);
46+
delay(1000);
47+
Serial.println("\n========================================");
48+
Serial.println("Matter Simple Window Blinds Example");
49+
Serial.println("========================================\n");
50+
51+
// CONFIG_ENABLE_CHIPOBLE is enabled when BLE is used to commission the Matter Network
52+
#if !CONFIG_ENABLE_CHIPOBLE
53+
// We start by connecting to a WiFi network
54+
Serial.print("Connecting to ");
55+
Serial.println(ssid);
56+
WiFi.mode(WIFI_STA);
57+
WiFi.begin(ssid, password);
58+
while (WiFi.status() != WL_CONNECTED) {
59+
delay(500);
60+
Serial.print(".");
61+
}
62+
Serial.println("");
63+
Serial.println("WiFi connected");
64+
Serial.print("IP address: ");
65+
Serial.println(WiFi.localIP());
66+
#endif
67+
68+
// Initialize Window Covering endpoint
69+
// Using ROLLERSHADE type (lift only, no tilt)
70+
WindowBlinds.begin(100, 0, MatterWindowCovering::ROLLERSHADE);
71+
72+
// Set up the onGoToLiftPercentage callback - this handles all window covering changes requested by the Matter Controller
73+
WindowBlinds.onGoToLiftPercentage(onBlindLift);
74+
75+
// Start Matter
76+
Matter.begin();
77+
Serial.println("Matter started");
78+
Serial.println();
79+
80+
// Print commissioning information
81+
Serial.println("========================================");
82+
Serial.println("Matter Node is not commissioned yet.");
83+
Serial.println("Initiate the device discovery in your Matter environment.");
84+
Serial.println("Commission it to your Matter hub with the manual pairing code or QR code");
85+
Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str());
86+
Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str());
87+
Serial.println("========================================");
88+
}
89+
90+
void loop() {
91+
delay(100);
92+
}

0 commit comments

Comments
 (0)