Skip to content

Commit

Permalink
ci(pre-commit): Apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Oct 1, 2024
1 parent 6e56936 commit 3961642
Show file tree
Hide file tree
Showing 31 changed files with 1,437 additions and 1,440 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
/**
* @brief This example demonstrates Zigbee Color Dimmable light bulb.
*
* The example demonstrates how to use Zigbee library to create an end device with
* The example demonstrates how to use Zigbee library to create an end device with
* color dimmable light end point.
* The light bulb is a Zigbee end device, which is controlled by a Zigbee coordinator.
*
* Proper Zigbee mode must be selected in Tools->Zigbee mode
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
*
* Please check the README.md for instructions and more detailed description.
*
*
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
*/

Expand All @@ -34,9 +34,9 @@
#include "ZigbeeCore.h"
#include "ep/ZigbeeColorDimmableLight.h"

#define LED_PIN RGB_BUILTIN
#define BUTTON_PIN 9 // C6/H2 Boot button
#define ZIGBEE_LIGHT_ENDPOINT 10
#define LED_PIN RGB_BUILTIN
#define BUTTON_PIN 9 // C6/H2 Boot button
#define ZIGBEE_LIGHT_ENDPOINT 10

ZigbeeColorDimmableLight zbColorLight = ZigbeeColorDimmableLight(ZIGBEE_LIGHT_ENDPOINT);

Expand All @@ -52,7 +52,7 @@ void identify(uint16_t time) {
log_d("Identify called for %d seconds", time);
if (time == 0) {
// If identify time is 0, stop blinking and restore light as it was used for identify
zbColorLight.restoreLight();
zbColorLight.restoreLight();
return;
}
rgbLedWrite(LED_PIN, 255 * blink, 255 * blink, 255 * blink);
Expand All @@ -79,7 +79,7 @@ void setup() {
// Add endpoint to Zigbee Core
log_d("Adding ZigbeeLight endpoint to Zigbee Core");
Zigbee.addEndpoint(&zbColorLight);

// When all EPs are registered, start Zigbee. By default acts as ZIGBEE_END_DEVICE
log_d("Calling Zigbee.begin()");
Zigbee.begin();
Expand All @@ -93,12 +93,12 @@ void loop() {
int startTime = millis();
while (digitalRead(BUTTON_PIN) == LOW) {
delay(50);
if((millis() - startTime) > 3000) {
if ((millis() - startTime) > 3000) {
// If key pressed for more than 3secs, factory reset Zigbee and reboot
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
Zigbee.factoryReset();
}
}
}
delay(100);
}
}
14 changes: 7 additions & 7 deletions libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light/ci.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
},
"fqbn": {
"fqbn": {
"esp32c6": [
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
],
"esp32h2": [
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
]
},
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
* The RGB light bulb is a Zigbee end device, which is controlled by a Zigbee coordinator (Switch).
* To turn on/off the light, push the button on the switch.
* To change the color or level of the light, send serial commands to the switch.
*
*
* By setting the switch to allow multiple binding, so it can bind to multiple lights.
* Also every 30 seconds, all bound lights are printed to the serial console.
*
* Proper Zigbee mode must be selected in Tools->Zigbee mode
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
*
* Please check the README.md for instructions and more detailed description.
*
*
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
*/

Expand All @@ -39,15 +39,15 @@
#include "ep/ZigbeeColorDimmerSwitch.h"

/* Switch configuration */
#define SWITCH_PIN 9 // ESP32-C6/H2 Boot button
#define SWITCH_PIN 9 // ESP32-C6/H2 Boot button
#define SWITCH_ENDPOINT_NUMBER 5

/* Zigbee switch */
ZigbeeColorDimmerSwitch zbSwitch = ZigbeeColorDimmerSwitch(SWITCH_ENDPOINT_NUMBER);

/********************* Arduino functions **************************/
void setup() {

Serial.begin(115200);
while (!Serial) {
delay(10);
Expand All @@ -67,14 +67,13 @@ void setup() {

//Open network for 180 seconds after boot
Zigbee.setRebootOpenNetwork(180);

//When all EPs are registered, start Zigbee with ZIGBEE_COORDINATOR mode
Zigbee.begin(ZIGBEE_COORDINATOR);

Serial.println("Waiting for Light to bound to the switch");
//Wait for switch to bound to a light:
while(!zbSwitch.isBound())
{
while (!zbSwitch.isBound()) {
Serial.printf(".");
delay(500);
}
Expand Down
14 changes: 7 additions & 7 deletions libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch/ci.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
},
"fqbn": {
"fqbn": {
"esp32c6": [
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
],
"esp32h2": [
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
]
},
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
*
* Please check the README.md for instructions and more detailed description.
*
*
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
*/

Expand All @@ -33,8 +33,8 @@
#include "ZigbeeCore.h"
#include "ep/ZigbeeLight.h"

#define LED_PIN RGB_BUILTIN
#define BUTTON_PIN 9 // ESP32-C6/H2 Boot button
#define LED_PIN RGB_BUILTIN
#define BUTTON_PIN 9 // ESP32-C6/H2 Boot button
#define ZIGBEE_LIGHT_ENDPOINT 10

ZigbeeLight zbLight = ZigbeeLight(ZIGBEE_LIGHT_ENDPOINT);
Expand Down Expand Up @@ -62,7 +62,7 @@ void setup() {
//Add endpoint to Zigbee Core
log_d("Adding ZigbeeLight endpoint to Zigbee Core");
Zigbee.addEndpoint(&zbLight);

// When all EPs are registered, start Zigbee. By default acts as ZIGBEE_END_DEVICE
log_d("Calling Zigbee.begin()");
Zigbee.begin();
Expand All @@ -76,12 +76,12 @@ void loop() {
int startTime = millis();
while (digitalRead(BUTTON_PIN) == LOW) {
delay(50);
if((millis() - startTime) > 3000) {
if ((millis() - startTime) > 3000) {
// If key pressed for more than 3secs, factory reset Zigbee and reboot
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
Zigbee.factoryReset();
}
}
}
delay(100);
}
}
14 changes: 7 additions & 7 deletions libraries/Zigbee/examples/Zigbee_On_Off_Light/ci.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
},
"fqbn": {
"fqbn": {
"esp32c6": [
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
],
"esp32h2": [
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
]
},
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
*
* Please check the README.md for instructions and more detailed description.
*
*
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
*/

Expand Down Expand Up @@ -94,7 +94,7 @@ static void enableGpioInterrupt(bool enabled) {

/********************* Arduino functions **************************/
void setup() {

Serial.begin(115200);
while (!Serial) {
delay(10);
Expand All @@ -112,7 +112,7 @@ void setup() {

//Open network for 180 seconds after boot
Zigbee.setRebootOpenNetwork(180);

// Init button switch
for (int i = 0; i < PAIR_SIZE(buttonFunctionPair); i++) {
pinMode(buttonFunctionPair[i].pin, INPUT_PULLUP);
Expand All @@ -128,21 +128,23 @@ void setup() {
// When all EPs are registered, start Zigbee with ZIGBEE_COORDINATOR mode
log_d("Calling Zigbee.begin()");
Zigbee.begin(ZIGBEE_COORDINATOR);

Serial.println("Waiting for Light to bound to the switch");
//Wait for switch to bound to a light:
while(!zbSwitch.isBound())
{
while (!zbSwitch.isBound()) {
Serial.printf(".");
delay(500);
}

// Optional: read manufacturer and model name from the bound light
std::list<zb_device_params_t*> boundLights = zbSwitch.getBoundDevices();
std::list<zb_device_params_t *> boundLights = zbSwitch.getBoundDevices();
//List all bound lights
for (const auto& device : boundLights) {
for (const auto &device : boundLights) {
Serial.printf("Device on endpoint %d, short address: 0x%x\n", device->endpoint, device->short_addr);
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]);
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]
);
Serial.printf("Light manufacturer: %s", zbSwitch.readManufacturer(device->endpoint, device->short_addr));
Serial.printf("Light model: %s", zbSwitch.readModel(device->endpoint, device->short_addr));
}
Expand All @@ -156,7 +158,6 @@ void loop() {
SwitchData buttonSwitch;
static SwitchState buttonState = SWITCH_IDLE;
bool eventFlag = false;


/* check if there is any queue received, if yes read out the buttonSwitch */
if (xQueueReceive(gpio_evt_queue, &buttonSwitch, portMAX_DELAY)) {
Expand Down
14 changes: 7 additions & 7 deletions libraries/Zigbee/examples/Zigbee_On_Off_Switch/ci.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
},
"fqbn": {
"fqbn": {
"esp32c6": [
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
],
"esp32h2": [
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
]
},
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* with proper Zigbee partition scheme in Tools->Partition Scheme.
*
* Please check the README.md for instructions and more detailed description.
*
*
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
*/

Expand All @@ -32,9 +32,9 @@
#include "ZigbeeCore.h"

#ifdef ZIGBEE_MODE_ZCZR
zigbee_role_t role = ZIGBEE_ROUTER; // or can be ZIGBEE_COORDINATOR, but it wont scan itself
zigbee_role_t role = ZIGBEE_ROUTER; // or can be ZIGBEE_COORDINATOR, but it wont scan itself
#else
zigbee_role_t role = ZIGBEE_END_DEVICE;
zigbee_role_t role = ZIGBEE_END_DEVICE;
#endif

void printScannedNetworks(uint16_t networksFound) {
Expand All @@ -60,10 +60,11 @@ void printScannedNetworks(uint16_t networksFound) {
Serial.print(" | ");
Serial.printf("%-19.19s", scan_result[i].end_device_capacity ? "Yes" : "No");
Serial.print(" | ");
Serial.printf("%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], 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], scan_result[i].extended_pan_id[0]);
Serial.printf(
"%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],
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],
scan_result[i].extended_pan_id[0]
);
Serial.println();
delay(10);
}
Expand Down
14 changes: 7 additions & 7 deletions libraries/Zigbee/examples/Zigbee_Scan_Networks/ci.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
},
"fqbn": {
"fqbn": {
"esp32c6": [
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
],
"esp32h2": [
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
]
},
"targets": {
"esp32": false,
"esp32c3": false,
"esp32s2": false,
"esp32s3": false
}
}
Loading

0 comments on commit 3961642

Please sign in to comment.