Skip to content

Commit 9f9d8f7

Browse files
ci(pre-commit): Apply automatic fixes
1 parent a9d322b commit 9f9d8f7

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

Diff for: libraries/Zigbee/examples/Zigbee_Gateway/Zigbee_Gateway.ino

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838

3939
/* Zigbee gateway configuration */
4040
#define GATEWAY_ENDPOINT_NUMBER 1
41-
#define GATEWAY_RCP_UART_PORT UART_NUM_1 // UART 0 is used for Serial communication
42-
#define GATEWAY_RCP_RX_PIN 4
43-
#define GATEWAY_RCP_TX_PIN 5
41+
#define GATEWAY_RCP_UART_PORT UART_NUM_1 // UART 0 is used for Serial communication
42+
#define GATEWAY_RCP_RX_PIN 4
43+
#define GATEWAY_RCP_TX_PIN 5
4444

4545
ZigbeeGateway zbGateway = ZigbeeGateway(GATEWAY_ENDPOINT_NUMBER);
4646

@@ -90,20 +90,20 @@ void setup() {
9090
esp_zb_radio_config_t radio_config = ZIGBEE_DEFAULT_UART_RCP_RADIO_CONFIG();
9191
radio_config.radio_uart_config.port = GATEWAY_RCP_UART_PORT;
9292
radio_config.radio_uart_config.rx_pin = (gpio_num_t)GATEWAY_RCP_RX_PIN;
93-
radio_config.radio_uart_config.tx_pin = (gpio_num_t)GATEWAY_RCP_TX_PIN;
93+
radio_config.radio_uart_config.tx_pin = (gpio_num_t)GATEWAY_RCP_TX_PIN;
9494

9595
Zigbee.setRadioConfig(radio_config);
9696

9797
// When all EPs are registered, start Zigbee with ZIGBEE_COORDINATOR or ZIGBEE_ROUTER mode
98-
if (!Zigbee.begin(ZIGBEE_COORDINATOR)) {
98+
if (!Zigbee.begin(ZIGBEE_COORDINATOR)) {
9999
Serial.println("Zigbee failed to start!");
100100
Serial.println("Rebooting...");
101101
ESP.restart();
102102
}
103103

104104
// set notification call-back function
105105
sntp_set_time_sync_notification_cb(timeavailable);
106-
sntp_set_sync_interval(30000); // sync every 30 seconds
106+
sntp_set_sync_interval(30000); // sync every 30 seconds
107107

108108
// config time zone and NTP servers
109109
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer1, ntpServer2);

Diff for: libraries/Zigbee/src/ZigbeeCore.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void ZigbeeCore::addEndpoint(ZigbeeEP *ep) {
8787
return;
8888
}
8989

90-
if(ep->_device_id == ESP_ZB_HA_HOME_GATEWAY_DEVICE_ID) {
90+
if (ep->_device_id == ESP_ZB_HA_HOME_GATEWAY_DEVICE_ID) {
9191
esp_zb_ep_list_add_gateway_ep(_zb_ep_list, ep->_cluster_list, ep->_ep_config);
9292
} else {
9393
esp_zb_ep_list_add_ep(_zb_ep_list, ep->_cluster_list, ep->_ep_config);

Diff for: libraries/Zigbee/src/ZigbeeCore.h

+18-17
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,24 @@ typedef enum {
6060
} \
6161
}
6262

63-
#define ZIGBEE_DEFAULT_UART_RCP_RADIO_CONFIG() \
64-
{ \
65-
.radio_mode = ZB_RADIO_MODE_UART_RCP, \
66-
.radio_uart_config = { \
67-
.port = UART_NUM_1, \
68-
.rx_pin = GPIO_NUM_NC, \
69-
.tx_pin = GPIO_NUM_NC, \
70-
.uart_config = { \
71-
.baud_rate = 460800, \
72-
.data_bits = UART_DATA_8_BITS, \
73-
.parity = UART_PARITY_DISABLE, \
74-
.stop_bits = UART_STOP_BITS_1, \
75-
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE, \
76-
.rx_flow_ctrl_thresh = 0, \
77-
.source_clk = UART_SCLK_DEFAULT, \
78-
}, \
79-
}, \
63+
#define ZIGBEE_DEFAULT_UART_RCP_RADIO_CONFIG() \
64+
{ \
65+
.radio_mode = ZB_RADIO_MODE_UART_RCP, \
66+
.radio_uart_config = { \
67+
.port = UART_NUM_1, \
68+
.rx_pin = GPIO_NUM_NC, \
69+
.tx_pin = GPIO_NUM_NC, \
70+
.uart_config = \
71+
{ \
72+
.baud_rate = 460800, \
73+
.data_bits = UART_DATA_8_BITS, \
74+
.parity = UART_PARITY_DISABLE, \
75+
.stop_bits = UART_STOP_BITS_1, \
76+
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE, \
77+
.rx_flow_ctrl_thresh = 0, \
78+
.source_clk = UART_SCLK_DEFAULT, \
79+
}, \
80+
}, \
8081
}
8182

8283
class ZigbeeCore {

Diff for: libraries/Zigbee/src/ZigbeeEP.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ tm ZigbeeEP::getTime(uint8_t endpoint, int32_t short_addr, esp_zb_ieee_addr_t ie
313313
// Update time status to synced
314314
_time_status |= 0x02;
315315
esp_zb_lock_acquire(portMAX_DELAY);
316-
esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_TIME, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TIME_TIME_STATUS_ID, &_time_status, false);
316+
esp_zb_zcl_set_attribute_val(
317+
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_TIME, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TIME_TIME_STATUS_ID, &_time_status, false
318+
);
317319
esp_zb_lock_release();
318320

319321
return *timeinfo;

0 commit comments

Comments
 (0)