Skip to content

Commit 3961642

Browse files
committed
ci(pre-commit): Apply automatic fixes
1 parent 6e56936 commit 3961642

31 files changed

+1437
-1440
lines changed

libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light/Zigbee_Color_Dimmable_Light.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
/**
1616
* @brief This example demonstrates Zigbee Color Dimmable light bulb.
1717
*
18-
* The example demonstrates how to use Zigbee library to create an end device with
18+
* The example demonstrates how to use Zigbee library to create an end device with
1919
* color dimmable light end point.
2020
* The light bulb is a Zigbee end device, which is controlled by a Zigbee coordinator.
2121
*
2222
* Proper Zigbee mode must be selected in Tools->Zigbee mode
2323
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
2424
*
2525
* Please check the README.md for instructions and more detailed description.
26-
*
26+
*
2727
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
2828
*/
2929

@@ -34,9 +34,9 @@
3434
#include "ZigbeeCore.h"
3535
#include "ep/ZigbeeColorDimmableLight.h"
3636

37-
#define LED_PIN RGB_BUILTIN
38-
#define BUTTON_PIN 9 // C6/H2 Boot button
39-
#define ZIGBEE_LIGHT_ENDPOINT 10
37+
#define LED_PIN RGB_BUILTIN
38+
#define BUTTON_PIN 9 // C6/H2 Boot button
39+
#define ZIGBEE_LIGHT_ENDPOINT 10
4040

4141
ZigbeeColorDimmableLight zbColorLight = ZigbeeColorDimmableLight(ZIGBEE_LIGHT_ENDPOINT);
4242

@@ -52,7 +52,7 @@ void identify(uint16_t time) {
5252
log_d("Identify called for %d seconds", time);
5353
if (time == 0) {
5454
// If identify time is 0, stop blinking and restore light as it was used for identify
55-
zbColorLight.restoreLight();
55+
zbColorLight.restoreLight();
5656
return;
5757
}
5858
rgbLedWrite(LED_PIN, 255 * blink, 255 * blink, 255 * blink);
@@ -79,7 +79,7 @@ void setup() {
7979
// Add endpoint to Zigbee Core
8080
log_d("Adding ZigbeeLight endpoint to Zigbee Core");
8181
Zigbee.addEndpoint(&zbColorLight);
82-
82+
8383
// When all EPs are registered, start Zigbee. By default acts as ZIGBEE_END_DEVICE
8484
log_d("Calling Zigbee.begin()");
8585
Zigbee.begin();
@@ -93,12 +93,12 @@ void loop() {
9393
int startTime = millis();
9494
while (digitalRead(BUTTON_PIN) == LOW) {
9595
delay(50);
96-
if((millis() - startTime) > 3000) {
96+
if ((millis() - startTime) > 3000) {
9797
// If key pressed for more than 3secs, factory reset Zigbee and reboot
9898
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
9999
Zigbee.factoryReset();
100100
}
101101
}
102102
}
103103
delay(100);
104-
}
104+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"targets": {
3-
"esp32": false,
4-
"esp32c3": false,
5-
"esp32s2": false,
6-
"esp32s3": false
7-
},
8-
"fqbn": {
2+
"fqbn": {
93
"esp32c6": [
104
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
115
],
126
"esp32h2": [
137
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
148
]
9+
},
10+
"targets": {
11+
"esp32": false,
12+
"esp32c3": false,
13+
"esp32s2": false,
14+
"esp32s3": false
1515
}
1616
}

libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch/Zigbee_Color_Dimmer_Switch.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
* The RGB light bulb is a Zigbee end device, which is controlled by a Zigbee coordinator (Switch).
2020
* To turn on/off the light, push the button on the switch.
2121
* To change the color or level of the light, send serial commands to the switch.
22-
*
22+
*
2323
* By setting the switch to allow multiple binding, so it can bind to multiple lights.
2424
* Also every 30 seconds, all bound lights are printed to the serial console.
2525
*
2626
* Proper Zigbee mode must be selected in Tools->Zigbee mode
2727
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
2828
*
2929
* Please check the README.md for instructions and more detailed description.
30-
*
30+
*
3131
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
3232
*/
3333

@@ -39,15 +39,15 @@
3939
#include "ep/ZigbeeColorDimmerSwitch.h"
4040

4141
/* Switch configuration */
42-
#define SWITCH_PIN 9 // ESP32-C6/H2 Boot button
42+
#define SWITCH_PIN 9 // ESP32-C6/H2 Boot button
4343
#define SWITCH_ENDPOINT_NUMBER 5
4444

4545
/* Zigbee switch */
4646
ZigbeeColorDimmerSwitch zbSwitch = ZigbeeColorDimmerSwitch(SWITCH_ENDPOINT_NUMBER);
4747

4848
/********************* Arduino functions **************************/
4949
void setup() {
50-
50+
5151
Serial.begin(115200);
5252
while (!Serial) {
5353
delay(10);
@@ -67,14 +67,13 @@ void setup() {
6767

6868
//Open network for 180 seconds after boot
6969
Zigbee.setRebootOpenNetwork(180);
70-
70+
7171
//When all EPs are registered, start Zigbee with ZIGBEE_COORDINATOR mode
7272
Zigbee.begin(ZIGBEE_COORDINATOR);
73-
73+
7474
Serial.println("Waiting for Light to bound to the switch");
7575
//Wait for switch to bound to a light:
76-
while(!zbSwitch.isBound())
77-
{
76+
while (!zbSwitch.isBound()) {
7877
Serial.printf(".");
7978
delay(500);
8079
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"targets": {
3-
"esp32": false,
4-
"esp32c3": false,
5-
"esp32s2": false,
6-
"esp32s3": false
7-
},
8-
"fqbn": {
2+
"fqbn": {
93
"esp32c6": [
104
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
115
],
126
"esp32h2": [
137
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
148
]
9+
},
10+
"targets": {
11+
"esp32": false,
12+
"esp32c3": false,
13+
"esp32s2": false,
14+
"esp32s3": false
1515
}
1616
}

libraries/Zigbee/examples/Zigbee_On_Off_Light/Zigbee_On_Off_Light.ino

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
2323
*
2424
* Please check the README.md for instructions and more detailed description.
25-
*
25+
*
2626
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
2727
*/
2828

@@ -33,8 +33,8 @@
3333
#include "ZigbeeCore.h"
3434
#include "ep/ZigbeeLight.h"
3535

36-
#define LED_PIN RGB_BUILTIN
37-
#define BUTTON_PIN 9 // ESP32-C6/H2 Boot button
36+
#define LED_PIN RGB_BUILTIN
37+
#define BUTTON_PIN 9 // ESP32-C6/H2 Boot button
3838
#define ZIGBEE_LIGHT_ENDPOINT 10
3939

4040
ZigbeeLight zbLight = ZigbeeLight(ZIGBEE_LIGHT_ENDPOINT);
@@ -62,7 +62,7 @@ void setup() {
6262
//Add endpoint to Zigbee Core
6363
log_d("Adding ZigbeeLight endpoint to Zigbee Core");
6464
Zigbee.addEndpoint(&zbLight);
65-
65+
6666
// When all EPs are registered, start Zigbee. By default acts as ZIGBEE_END_DEVICE
6767
log_d("Calling Zigbee.begin()");
6868
Zigbee.begin();
@@ -76,12 +76,12 @@ void loop() {
7676
int startTime = millis();
7777
while (digitalRead(BUTTON_PIN) == LOW) {
7878
delay(50);
79-
if((millis() - startTime) > 3000) {
79+
if ((millis() - startTime) > 3000) {
8080
// If key pressed for more than 3secs, factory reset Zigbee and reboot
8181
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
8282
Zigbee.factoryReset();
8383
}
8484
}
8585
}
8686
delay(100);
87-
}
87+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"targets": {
3-
"esp32": false,
4-
"esp32c3": false,
5-
"esp32s2": false,
6-
"esp32s3": false
7-
},
8-
"fqbn": {
2+
"fqbn": {
93
"esp32c6": [
104
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
115
],
126
"esp32h2": [
137
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
148
]
9+
},
10+
"targets": {
11+
"esp32": false,
12+
"esp32c3": false,
13+
"esp32s2": false,
14+
"esp32s3": false
1515
}
1616
}

libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino

+11-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
2424
*
2525
* Please check the README.md for instructions and more detailed description.
26-
*
26+
*
2727
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
2828
*/
2929

@@ -94,7 +94,7 @@ static void enableGpioInterrupt(bool enabled) {
9494

9595
/********************* Arduino functions **************************/
9696
void setup() {
97-
97+
9898
Serial.begin(115200);
9999
while (!Serial) {
100100
delay(10);
@@ -112,7 +112,7 @@ void setup() {
112112

113113
//Open network for 180 seconds after boot
114114
Zigbee.setRebootOpenNetwork(180);
115-
115+
116116
// Init button switch
117117
for (int i = 0; i < PAIR_SIZE(buttonFunctionPair); i++) {
118118
pinMode(buttonFunctionPair[i].pin, INPUT_PULLUP);
@@ -128,21 +128,23 @@ void setup() {
128128
// When all EPs are registered, start Zigbee with ZIGBEE_COORDINATOR mode
129129
log_d("Calling Zigbee.begin()");
130130
Zigbee.begin(ZIGBEE_COORDINATOR);
131-
131+
132132
Serial.println("Waiting for Light to bound to the switch");
133133
//Wait for switch to bound to a light:
134-
while(!zbSwitch.isBound())
135-
{
134+
while (!zbSwitch.isBound()) {
136135
Serial.printf(".");
137136
delay(500);
138137
}
139138

140139
// Optional: read manufacturer and model name from the bound light
141-
std::list<zb_device_params_t*> boundLights = zbSwitch.getBoundDevices();
140+
std::list<zb_device_params_t *> boundLights = zbSwitch.getBoundDevices();
142141
//List all bound lights
143-
for (const auto& device : boundLights) {
142+
for (const auto &device : boundLights) {
144143
Serial.printf("Device on endpoint %d, short address: 0x%x\n", device->endpoint, device->short_addr);
145-
Serial.printf("IEEE Address: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", device->ieee_addr[0], device->ieee_addr[1], device->ieee_addr[2], device->ieee_addr[3], device->ieee_addr[4], device->ieee_addr[5], device->ieee_addr[6], device->ieee_addr[7]);
144+
Serial.printf(
145+
"IEEE Address: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", device->ieee_addr[0], device->ieee_addr[1], device->ieee_addr[2], device->ieee_addr[3],
146+
device->ieee_addr[4], device->ieee_addr[5], device->ieee_addr[6], device->ieee_addr[7]
147+
);
146148
Serial.printf("Light manufacturer: %s", zbSwitch.readManufacturer(device->endpoint, device->short_addr));
147149
Serial.printf("Light model: %s", zbSwitch.readModel(device->endpoint, device->short_addr));
148150
}
@@ -156,7 +158,6 @@ void loop() {
156158
SwitchData buttonSwitch;
157159
static SwitchState buttonState = SWITCH_IDLE;
158160
bool eventFlag = false;
159-
160161

161162
/* check if there is any queue received, if yes read out the buttonSwitch */
162163
if (xQueueReceive(gpio_evt_queue, &buttonSwitch, portMAX_DELAY)) {
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"targets": {
3-
"esp32": false,
4-
"esp32c3": false,
5-
"esp32s2": false,
6-
"esp32s3": false
7-
},
8-
"fqbn": {
2+
"fqbn": {
93
"esp32c6": [
104
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
115
],
126
"esp32h2": [
137
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
148
]
9+
},
10+
"targets": {
11+
"esp32": false,
12+
"esp32c3": false,
13+
"esp32s2": false,
14+
"esp32s3": false
1515
}
1616
}

libraries/Zigbee/examples/Zigbee_Scan_Networks/Zigbee_Scan_Networks.ino

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* with proper Zigbee partition scheme in Tools->Partition Scheme.
2222
*
2323
* Please check the README.md for instructions and more detailed description.
24-
*
24+
*
2525
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
2626
*/
2727

@@ -32,9 +32,9 @@
3232
#include "ZigbeeCore.h"
3333

3434
#ifdef ZIGBEE_MODE_ZCZR
35-
zigbee_role_t role = ZIGBEE_ROUTER; // or can be ZIGBEE_COORDINATOR, but it wont scan itself
35+
zigbee_role_t role = ZIGBEE_ROUTER; // or can be ZIGBEE_COORDINATOR, but it wont scan itself
3636
#else
37-
zigbee_role_t role = ZIGBEE_END_DEVICE;
37+
zigbee_role_t role = ZIGBEE_END_DEVICE;
3838
#endif
3939

4040
void printScannedNetworks(uint16_t networksFound) {
@@ -60,10 +60,11 @@ void printScannedNetworks(uint16_t networksFound) {
6060
Serial.print(" | ");
6161
Serial.printf("%-19.19s", scan_result[i].end_device_capacity ? "Yes" : "No");
6262
Serial.print(" | ");
63-
Serial.printf("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", scan_result[i].extended_pan_id[7], scan_result[i].extended_pan_id[6],
64-
scan_result[i].extended_pan_id[5], scan_result[i].extended_pan_id[4],
65-
scan_result[i].extended_pan_id[3], scan_result[i].extended_pan_id[2],
66-
scan_result[i].extended_pan_id[1], scan_result[i].extended_pan_id[0]);
63+
Serial.printf(
64+
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", scan_result[i].extended_pan_id[7], scan_result[i].extended_pan_id[6], scan_result[i].extended_pan_id[5],
65+
scan_result[i].extended_pan_id[4], scan_result[i].extended_pan_id[3], scan_result[i].extended_pan_id[2], scan_result[i].extended_pan_id[1],
66+
scan_result[i].extended_pan_id[0]
67+
);
6768
Serial.println();
6869
delay(10);
6970
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"targets": {
3-
"esp32": false,
4-
"esp32c3": false,
5-
"esp32s2": false,
6-
"esp32s3": false
7-
},
8-
"fqbn": {
2+
"fqbn": {
93
"esp32c6": [
104
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
115
],
126
"esp32h2": [
137
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
148
]
9+
},
10+
"targets": {
11+
"esp32": false,
12+
"esp32c3": false,
13+
"esp32s2": false,
14+
"esp32s3": false
1515
}
1616
}

0 commit comments

Comments
 (0)