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
pre-commit-ci-lite[bot] authored Oct 1, 2024
1 parent 6e56936 commit 4c4313a
Show file tree
Hide file tree
Showing 26 changed files with 2,612 additions and 2,253 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);
}
}
Loading

0 comments on commit 4c4313a

Please sign in to comment.