Skip to content

Commit f352c9a

Browse files
ci(pre-commit): Apply automatic fixes
1 parent c7dd76a commit f352c9a

File tree

7 files changed

+17
-15
lines changed

7 files changed

+17
-15
lines changed

libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER);
4242

4343
/************************ Temp sensor *****************************/
44-
void meausureAndSleep(){
44+
void meausureAndSleep() {
4545
// Measure temperature sensor value
4646
float temperature = temperatureRead();
4747

@@ -84,7 +84,7 @@ void setup() {
8484
zbTempSensor.setPowerSource(ZB_POWER_SOURCE_BATTERY, 100);
8585

8686
// Add humidity cluster to the temperature sensor device with min, max and tolerance values
87-
zbTempSensor.addHumiditySensor(0,100,1);
87+
zbTempSensor.addHumiditySensor(0, 100, 1);
8888

8989
// Add endpoint to Zigbee Core
9090
Zigbee.addEndpoint(&zbTempSensor);
@@ -97,7 +97,7 @@ void setup() {
9797
Zigbee.begin(&zigbeeConfig, false);
9898

9999
// Wait for Zigbee to start
100-
while(!Zigbee.isStarted()){
100+
while (!Zigbee.isStarted()) {
101101
delay(100);
102102
}
103103

libraries/Zigbee/src/ZigbeeCore.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ static void esp_zb_task(void *pvParameters) {
7878
ESP_ERROR_CHECK(esp_zb_start(false));
7979

8080
//NOTE: This is a workaround to make battery powered devices to be discovered as battery powered
81-
if(((zigbee_role_t)Zigbee.getRole() == ZIGBEE_END_DEVICE) && edBatteryPowered ) {
82-
zb_set_ed_node_descriptor(0,0,0);
81+
if (((zigbee_role_t)Zigbee.getRole() == ZIGBEE_END_DEVICE) && edBatteryPowered) {
82+
zb_set_ed_node_descriptor(0, 0, 0);
8383
}
8484

8585
esp_zb_stack_main_loop();
@@ -118,7 +118,7 @@ bool ZigbeeCore::zigbeeInit(esp_zb_cfg_t *zb_cfg, bool erase_nvs) {
118118
log_i("List of registered Zigbee EPs:");
119119
for (std::list<ZigbeeEP *>::iterator it = ep_objects.begin(); it != ep_objects.end(); ++it) {
120120
log_i("Device type: %s, Endpoint: %d, Device ID: 0x%04x", getDeviceTypeString((*it)->_device_id), (*it)->_endpoint, (*it)->_device_id);
121-
if((*it)->_power_source == ZB_POWER_SOURCE_BATTERY) {
121+
if ((*it)->_power_source == ZB_POWER_SOURCE_BATTERY) {
122122
edBatteryPowered = true;
123123
}
124124
}

libraries/Zigbee/src/ZigbeeEP.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void ZigbeeEP::setPowerSource(zb_power_source_t power_source, uint8_t battery_pe
7373
esp_zb_attribute_list_t *basic_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
7474
esp_zb_cluster_update_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_POWER_SOURCE_ID, (void *)&power_source);
7575

76-
if(power_source == ZB_POWER_SOURCE_BATTERY){
76+
if (power_source == ZB_POWER_SOURCE_BATTERY) {
7777
// Add power config cluster and battery percentage attribute
7878
battery_percentage = battery_percentage * 2;
7979
esp_zb_attribute_list_t *power_config_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG);
@@ -92,14 +92,15 @@ void ZigbeeEP::setBatteryPercentage(uint8_t percentage) {
9292
percentage = percentage * 2;
9393
esp_zb_lock_acquire(portMAX_DELAY);
9494
esp_zb_zcl_set_attribute_val(
95-
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID, &percentage, false
95+
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID, &percentage,
96+
false
9697
);
9798
esp_zb_lock_release();
9899
log_v("Battery percentage updated");
99100
}
100101

101102
void ZigbeeEP::reportBatteryPercentage() {
102-
/* Send report attributes command */
103+
/* Send report attributes command */
103104
esp_zb_zcl_report_attr_cmd_t report_attr_cmd;
104105
report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT;
105106
report_attr_cmd.attributeID = ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID;
@@ -201,7 +202,7 @@ void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute) {
201202

202203
void ZigbeeEP::zbIdentify(const esp_zb_zcl_set_attr_value_message_t *message) {
203204
if (message->attribute.id == ESP_ZB_ZCL_CMD_IDENTIFY_IDENTIFY_ID && message->attribute.data.type == ESP_ZB_ZCL_ATTR_TYPE_U16) {
204-
if(_on_identify != NULL) {
205+
if (_on_identify != NULL) {
205206
_on_identify(*(uint16_t *)message->attribute.data.value);
206207
}
207208
} else {

libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void ZigbeeColorDimmerSwitch::findCb(esp_zb_zdp_status_t zdo_status, uint16_t ad
5757
light->short_addr = addr;
5858
esp_zb_ieee_address_by_short(light->short_addr, light->ieee_addr);
5959
esp_zb_get_long_address(bind_req.src_address);
60-
bind_req.src_endp = *((uint8_t*)user_ctx); //_endpoint;
60+
bind_req.src_endp = *((uint8_t *)user_ctx); //_endpoint;
6161
bind_req.cluster_id = ESP_ZB_ZCL_CLUSTER_ID_ON_OFF;
6262
bind_req.dst_addr_mode = ESP_ZB_ZDO_BIND_DST_ADDR_MODE_64_BIT_EXTENDED;
6363
memcpy(bind_req.dst_address_u.addr_long, light->ieee_addr, sizeof(esp_zb_ieee_addr_t));

libraries/Zigbee/src/ep/ZigbeeSwitch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void ZigbeeSwitch::findCb(esp_zb_zdp_status_t zdo_status, uint16_t addr, uint8_t
3535
light->short_addr = addr;
3636
esp_zb_ieee_address_by_short(light->short_addr, light->ieee_addr);
3737
esp_zb_get_long_address(bind_req.src_address);
38-
bind_req.src_endp = *((uint8_t*)user_ctx); //_endpoint;
38+
bind_req.src_endp = *((uint8_t *)user_ctx); //_endpoint;
3939
bind_req.cluster_id = ESP_ZB_ZCL_CLUSTER_ID_ON_OFF;
4040
bind_req.dst_addr_mode = ESP_ZB_ZDO_BIND_DST_ADDR_MODE_64_BIT_EXTENDED;
4141
memcpy(bind_req.dst_address_u.addr_long, light->ieee_addr, sizeof(esp_zb_ieee_addr_t));

libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ void ZigbeeTempSensor::setHumidity(float humidity) {
110110
log_d("Setting humidity to %d", zb_humidity);
111111
esp_zb_lock_acquire(portMAX_DELAY);
112112
esp_zb_zcl_set_attribute_val(
113-
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID, &zb_humidity, false
113+
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID, &zb_humidity,
114+
false
114115
);
115116
esp_zb_lock_release();
116117
}

libraries/Zigbee/src/ep/ZigbeeThermostat.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void ZigbeeThermostat::findCb(esp_zb_zdp_status_t zdo_status, uint16_t addr, uin
6767
/* populate the dst information of the binding */
6868
bind_req.dst_addr_mode = ESP_ZB_ZDO_BIND_DST_ADDR_MODE_64_BIT_EXTENDED;
6969
esp_zb_get_long_address(bind_req.dst_address_u.addr_long);
70-
bind_req.dst_endp = *((uint8_t*)user_ctx); //_endpoint;
70+
bind_req.dst_endp = *((uint8_t *)user_ctx); //_endpoint;
7171

7272
log_i("Request temperature sensor to bind us");
7373
esp_zb_zdo_device_bind_req(&bind_req, bindCb, NULL);
@@ -77,7 +77,7 @@ void ZigbeeThermostat::findCb(esp_zb_zdp_status_t zdo_status, uint16_t addr, uin
7777

7878
/* populate the src information of the binding */
7979
esp_zb_get_long_address(bind_req.src_address);
80-
bind_req.src_endp = *((uint8_t*)user_ctx); //_endpoint;
80+
bind_req.src_endp = *((uint8_t *)user_ctx); //_endpoint;
8181
bind_req.cluster_id = ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;
8282

8383
/* populate the dst information of the binding */

0 commit comments

Comments
 (0)