Skip to content

Commit b6d0553

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 6bc971c commit b6d0553

13 files changed

+70
-81
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void loop() {
8181
// Read carbon dioxide sensor every 2s
8282
if (!(timeCounter++ % 20)) { // delaying for 100ms x 20 = 2s
8383
// Read sensor value - here is chip temperature used + 300 as a dummy value for demonstration
84-
uint16_t carbon_dioxide_value = 300+(uint16_t)temperatureRead();
84+
uint16_t carbon_dioxide_value = 300 + (uint16_t)temperatureRead();
8585
Serial.printf("Updating carbon dioxide sensor value to %d ppm\r\n", carbon_dioxide_value);
8686
zbCarbonDioxideSensor.setCarbonDioxide(carbon_dioxide_value);
8787
}

Diff for: libraries/Zigbee/examples/Zigbee_Occupancy_Sensor/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To get more information about the Espressif boards see [Espressif Development Ki
3030

3131
## Troubleshooting
3232

33-
If the End device flashed with this example is not connecting to the coordinator, erase the flash of the End device before flashing the example to the board.
33+
If the End device flashed with this example is not connecting to the coordinator, erase the flash of the End device before flashing the example to the board.
3434

3535
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
3636

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void setup() {
7373
void loop() {
7474
// Checking PIR sensor for occupancy change
7575
static bool occupancy = false;
76-
if(digitalRead(sensor_pin) == HIGH && !occupancy) {
76+
if (digitalRead(sensor_pin) == HIGH && !occupancy) {
7777
// Update occupancy sensor value
7878
zbOccupancySensor.setOccupancy(true);
7979
zbOccupancySensor.report();

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "Zigbee.h"
3434

3535
/* Zigbee flow + pressure sensor configuration */
36-
#define FLOW_SENSOR_ENDPOINT_NUMBER 10
36+
#define FLOW_SENSOR_ENDPOINT_NUMBER 10
3737
#define PRESSURE_SENSOR_ENDPOINT_NUMBER 11
3838

3939
uint8_t button = BOOT_PIN;
@@ -100,7 +100,7 @@ void loop() {
100100
// Read flow and pressure sensors every 2s
101101
if (!(timeCounter++ % 20)) { // delaying for 100ms x 20 = 2s
102102
float flow_value = temperatureRead();
103-
uint16_t pressure_value = (uint16_t)temperatureRead()*100; //*100 for demonstration so the value is in 1000-3000hPa
103+
uint16_t pressure_value = (uint16_t)temperatureRead() * 100; //*100 for demonstration so the value is in 1000-3000hPa
104104
Serial.printf("Updating flow sensor value to %.2f m3/h\r\n", flow_value);
105105
zbFlowSensor.setFlow(flow_value);
106106
Serial.printf("Updating pressure sensor value to %d hPa\r\n", pressure_value);

Diff for: libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#include "ZigbeeCarbonDioxideSensor.h"
22
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

4-
esp_zb_cluster_list_t *zigbee_carbon_dioxide_sensor_clusters_create(zigbee_carbon_dioxide_sensor_cfg_t *carbon_dioxide_sensor)
5-
{
6-
esp_zb_basic_cluster_cfg_t *basic_cfg = carbon_dioxide_sensor ? &(carbon_dioxide_sensor->basic_cfg) : NULL;
7-
esp_zb_identify_cluster_cfg_t *identify_cfg = carbon_dioxide_sensor ? &(carbon_dioxide_sensor->identify_cfg) : NULL;
8-
esp_zb_carbon_dioxide_measurement_cluster_cfg_t *carbon_dioxide_meas_cfg = carbon_dioxide_sensor ? &(carbon_dioxide_sensor->carbon_dioxide_meas_cfg) : NULL;
9-
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
10-
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12-
esp_zb_cluster_list_add_carbon_dioxide_measurement_cluster(cluster_list, esp_zb_carbon_dioxide_measurement_cluster_create(carbon_dioxide_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
14-
return cluster_list;
4+
esp_zb_cluster_list_t *zigbee_carbon_dioxide_sensor_clusters_create(zigbee_carbon_dioxide_sensor_cfg_t *carbon_dioxide_sensor) {
5+
esp_zb_basic_cluster_cfg_t *basic_cfg = carbon_dioxide_sensor ? &(carbon_dioxide_sensor->basic_cfg) : NULL;
6+
esp_zb_identify_cluster_cfg_t *identify_cfg = carbon_dioxide_sensor ? &(carbon_dioxide_sensor->identify_cfg) : NULL;
7+
esp_zb_carbon_dioxide_measurement_cluster_cfg_t *carbon_dioxide_meas_cfg = carbon_dioxide_sensor ? &(carbon_dioxide_sensor->carbon_dioxide_meas_cfg) : NULL;
8+
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
9+
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
10+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11+
esp_zb_cluster_list_add_carbon_dioxide_measurement_cluster(
12+
cluster_list, esp_zb_carbon_dioxide_measurement_cluster_create(carbon_dioxide_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE
13+
);
14+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
15+
return cluster_list;
1516
}
1617

1718
ZigbeeCarbonDioxideSensor::ZigbeeCarbonDioxideSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
@@ -21,29 +22,27 @@ ZigbeeCarbonDioxideSensor::ZigbeeCarbonDioxideSensor(uint8_t endpoint) : ZigbeeE
2122
zigbee_carbon_dioxide_sensor_cfg_t carbon_dioxide_sensor_cfg = ZIGBEE_DEFAULT_CARBON_DIOXIDE_SENSOR_CONFIG();
2223
_cluster_list = zigbee_carbon_dioxide_sensor_clusters_create(&carbon_dioxide_sensor_cfg);
2324

24-
_ep_config = {
25-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0
26-
};
25+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
2726
}
2827

2928
void ZigbeeCarbonDioxideSensor::setMinMaxValue(float min, float max) {
30-
float zb_min = min/1000000.0f;
31-
float zb_max = max/1000000.0f;
29+
float zb_min = min / 1000000.0f;
30+
float zb_max = max / 1000000.0f;
3231
esp_zb_attribute_list_t *carbon_dioxide_measure_cluster =
3332
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
3433
esp_zb_cluster_update_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&zb_min);
3534
esp_zb_cluster_update_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&zb_max);
3635
}
3736

3837
void ZigbeeCarbonDioxideSensor::setTolerance(float tolerance) {
39-
float zb_tolerance = tolerance/1000000.0f;
38+
float zb_tolerance = tolerance / 1000000.0f;
4039
esp_zb_attribute_list_t *carbon_dioxide_measure_cluster =
4140
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
4241
esp_zb_temperature_meas_cluster_add_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance);
4342
}
4443

4544
void ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) {
46-
if(delta > 0) {
45+
if (delta > 0) {
4746
log_e("Delta reporting is currently not supported by the carbon dioxide sensor");
4847
}
4948
// clang-format off
@@ -80,13 +79,14 @@ void ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max
8079
}
8180

8281
void ZigbeeCarbonDioxideSensor::setCarbonDioxide(float carbon_dioxide) {
83-
float zb_carbon_dioxide = carbon_dioxide/1000000.0f;
82+
float zb_carbon_dioxide = carbon_dioxide / 1000000.0f;
8483
log_v("Updating carbon dioxide sensor value...");
8584
/* Update carbon dioxide sensor measured value */
8685
log_d("Setting carbon dioxide to %0.1f", carbon_dioxide);
8786
esp_zb_lock_acquire(portMAX_DELAY);
8887
esp_zb_zcl_set_attribute_val(
89-
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MEASURED_VALUE_ID, &zb_carbon_dioxide, false
88+
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MEASURED_VALUE_ID,
89+
&zb_carbon_dioxide, false
9090
);
9191
esp_zb_lock_release();
9292
}

Diff for: libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
// clang-format on
3232

3333
typedef struct zigbee_carbon_dioxide_sensor_cfg_s {
34-
esp_zb_basic_cluster_cfg_t basic_cfg;
35-
esp_zb_identify_cluster_cfg_t identify_cfg;
36-
esp_zb_carbon_dioxide_measurement_cluster_cfg_t carbon_dioxide_meas_cfg;
34+
esp_zb_basic_cluster_cfg_t basic_cfg;
35+
esp_zb_identify_cluster_cfg_t identify_cfg;
36+
esp_zb_carbon_dioxide_measurement_cluster_cfg_t carbon_dioxide_meas_cfg;
3737
} zigbee_carbon_dioxide_sensor_cfg_t;
3838

3939
class ZigbeeCarbonDioxideSensor : public ZigbeeEP {

Diff for: libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#include "ZigbeeFlowSensor.h"
22
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

4-
esp_zb_cluster_list_t *zigbee_flow_sensor_clusters_create(zigbee_flow_sensor_cfg_t *flow_sensor)
5-
{
6-
esp_zb_basic_cluster_cfg_t *basic_cfg = flow_sensor ? &(flow_sensor->basic_cfg) : NULL;
7-
esp_zb_identify_cluster_cfg_t *identify_cfg = flow_sensor ? &(flow_sensor->identify_cfg) : NULL;
8-
esp_zb_flow_meas_cluster_cfg_t *flow_meas_cfg = flow_sensor ? &(flow_sensor->flow_meas_cfg) : NULL;
9-
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
10-
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12-
esp_zb_cluster_list_add_flow_meas_cluster(cluster_list, esp_zb_flow_meas_cluster_create(flow_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
14-
return cluster_list;
4+
esp_zb_cluster_list_t *zigbee_flow_sensor_clusters_create(zigbee_flow_sensor_cfg_t *flow_sensor) {
5+
esp_zb_basic_cluster_cfg_t *basic_cfg = flow_sensor ? &(flow_sensor->basic_cfg) : NULL;
6+
esp_zb_identify_cluster_cfg_t *identify_cfg = flow_sensor ? &(flow_sensor->identify_cfg) : NULL;
7+
esp_zb_flow_meas_cluster_cfg_t *flow_meas_cfg = flow_sensor ? &(flow_sensor->flow_meas_cfg) : NULL;
8+
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
9+
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
10+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11+
esp_zb_cluster_list_add_flow_meas_cluster(cluster_list, esp_zb_flow_meas_cluster_create(flow_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13+
return cluster_list;
1514
}
1615

1716
ZigbeeFlowSensor::ZigbeeFlowSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
@@ -21,9 +20,7 @@ ZigbeeFlowSensor::ZigbeeFlowSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
2120
zigbee_flow_sensor_cfg_t flow_sensor_cfg = ZIGBEE_DEFAULT_FLOW_SENSOR_CONFIG();
2221
_cluster_list = zigbee_flow_sensor_clusters_create(&flow_sensor_cfg);
2322

24-
_ep_config = {
25-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0
26-
};
23+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
2724
}
2825

2926
void ZigbeeFlowSensor::setMinMaxValue(float min, float max) {

Diff for: libraries/Zigbee/src/ep/ZigbeeFlowSensor.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
// clang-format on
3232

3333
typedef struct zigbee_flow_sensor_cfg_s {
34-
esp_zb_basic_cluster_cfg_t basic_cfg;
35-
esp_zb_identify_cluster_cfg_t identify_cfg;
36-
esp_zb_flow_meas_cluster_cfg_t flow_meas_cfg;
34+
esp_zb_basic_cluster_cfg_t basic_cfg;
35+
esp_zb_identify_cluster_cfg_t identify_cfg;
36+
esp_zb_flow_meas_cluster_cfg_t flow_meas_cfg;
3737
} zigbee_flow_sensor_cfg_t;
3838

3939
class ZigbeeFlowSensor : public ZigbeeEP {

Diff for: libraries/Zigbee/src/ep/ZigbeeOccupancySensor.cpp

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#include "ZigbeeOccupancySensor.h"
22
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

4-
esp_zb_cluster_list_t *zigbee_occupancy_sensor_clusters_create(zigbee_occupancy_sensor_cfg_t *occupancy_sensor)
5-
{
6-
esp_zb_basic_cluster_cfg_t *basic_cfg = occupancy_sensor ? &(occupancy_sensor->basic_cfg) : NULL;
7-
esp_zb_identify_cluster_cfg_t *identify_cfg = occupancy_sensor ? &(occupancy_sensor->identify_cfg) : NULL;
8-
esp_zb_occupancy_sensing_cluster_cfg_t *occupancy_meas_cfg = occupancy_sensor ? &(occupancy_sensor->occupancy_meas_cfg) : NULL;
9-
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
10-
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12-
esp_zb_cluster_list_add_occupancy_sensing_cluster(cluster_list, esp_zb_occupancy_sensing_cluster_create(occupancy_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
14-
return cluster_list;
4+
esp_zb_cluster_list_t *zigbee_occupancy_sensor_clusters_create(zigbee_occupancy_sensor_cfg_t *occupancy_sensor) {
5+
esp_zb_basic_cluster_cfg_t *basic_cfg = occupancy_sensor ? &(occupancy_sensor->basic_cfg) : NULL;
6+
esp_zb_identify_cluster_cfg_t *identify_cfg = occupancy_sensor ? &(occupancy_sensor->identify_cfg) : NULL;
7+
esp_zb_occupancy_sensing_cluster_cfg_t *occupancy_meas_cfg = occupancy_sensor ? &(occupancy_sensor->occupancy_meas_cfg) : NULL;
8+
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
9+
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
10+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11+
esp_zb_cluster_list_add_occupancy_sensing_cluster(cluster_list, esp_zb_occupancy_sensing_cluster_create(occupancy_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13+
return cluster_list;
1514
}
1615

1716
ZigbeeOccupancySensor::ZigbeeOccupancySensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
@@ -21,9 +20,7 @@ ZigbeeOccupancySensor::ZigbeeOccupancySensor(uint8_t endpoint) : ZigbeeEP(endpoi
2120
zigbee_occupancy_sensor_cfg_t occupancy_sensor_cfg = ZIGBEE_DEFAULT_OCCUPANCY_SENSOR_CONFIG();
2221
_cluster_list = zigbee_occupancy_sensor_clusters_create(&occupancy_sensor_cfg);
2322

24-
_ep_config = {
25-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0
26-
};
23+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
2724
}
2825

2926
void ZigbeeOccupancySensor::setSensorType(uint8_t sensor_type) {

Diff for: libraries/Zigbee/src/ep/ZigbeeOccupancySensor.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
// clang-format on
3232

3333
typedef struct zigbee_occupancy_sensor_cfg_s {
34-
esp_zb_basic_cluster_cfg_t basic_cfg;
35-
esp_zb_identify_cluster_cfg_t identify_cfg;
36-
esp_zb_occupancy_sensing_cluster_cfg_t occupancy_meas_cfg;
34+
esp_zb_basic_cluster_cfg_t basic_cfg;
35+
esp_zb_identify_cluster_cfg_t identify_cfg;
36+
esp_zb_occupancy_sensing_cluster_cfg_t occupancy_meas_cfg;
3737
} zigbee_occupancy_sensor_cfg_t;
3838

3939
class ZigbeeOccupancySensor : public ZigbeeEP {

Diff for: libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#include "ZigbeePressureSensor.h"
22
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

4-
esp_zb_cluster_list_t *zigbee_pressure_sensor_clusters_create(zigbee_pressure_sensor_cfg_t *pressure_sensor)
5-
{
6-
esp_zb_basic_cluster_cfg_t *basic_cfg = pressure_sensor ? &(pressure_sensor->basic_cfg) : NULL;
7-
esp_zb_identify_cluster_cfg_t *identify_cfg = pressure_sensor ? &(pressure_sensor->identify_cfg) : NULL;
8-
esp_zb_pressure_meas_cluster_cfg_t *pressure_meas_cfg = pressure_sensor ? &(pressure_sensor->pressure_meas_cfg) : NULL;
9-
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
10-
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12-
esp_zb_cluster_list_add_pressure_meas_cluster(cluster_list, esp_zb_pressure_meas_cluster_create(pressure_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13-
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
14-
return cluster_list;
4+
esp_zb_cluster_list_t *zigbee_pressure_sensor_clusters_create(zigbee_pressure_sensor_cfg_t *pressure_sensor) {
5+
esp_zb_basic_cluster_cfg_t *basic_cfg = pressure_sensor ? &(pressure_sensor->basic_cfg) : NULL;
6+
esp_zb_identify_cluster_cfg_t *identify_cfg = pressure_sensor ? &(pressure_sensor->identify_cfg) : NULL;
7+
esp_zb_pressure_meas_cluster_cfg_t *pressure_meas_cfg = pressure_sensor ? &(pressure_sensor->pressure_meas_cfg) : NULL;
8+
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
9+
esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
10+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
11+
esp_zb_cluster_list_add_pressure_meas_cluster(cluster_list, esp_zb_pressure_meas_cluster_create(pressure_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
12+
esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
13+
return cluster_list;
1514
}
1615

1716
ZigbeePressureSensor::ZigbeePressureSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
@@ -21,9 +20,7 @@ ZigbeePressureSensor::ZigbeePressureSensor(uint8_t endpoint) : ZigbeeEP(endpoint
2120
zigbee_pressure_sensor_cfg_t presssure_sensor_cfg = ZIGBEE_DEFAULT_PRESSURE_SENSOR_CONFIG();
2221
_cluster_list = zigbee_pressure_sensor_clusters_create(&presssure_sensor_cfg);
2322

24-
_ep_config = {
25-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0
26-
};
23+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
2724
}
2825

2926
void ZigbeePressureSensor::setMinMaxValue(int16_t min, int16_t max) {

Diff for: libraries/Zigbee/src/ep/ZigbeePressureSensor.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
// clang-format on
3232

3333
typedef struct zigbee_pressure_sensor_cfg_s {
34-
esp_zb_basic_cluster_cfg_t basic_cfg;
35-
esp_zb_identify_cluster_cfg_t identify_cfg;
36-
esp_zb_pressure_meas_cluster_cfg_t pressure_meas_cfg;
34+
esp_zb_basic_cluster_cfg_t basic_cfg;
35+
esp_zb_identify_cluster_cfg_t identify_cfg;
36+
esp_zb_pressure_meas_cluster_cfg_t pressure_meas_cfg;
3737
} zigbee_pressure_sensor_cfg_t;
3838

3939
class ZigbeePressureSensor : public ZigbeeEP {

Diff for: libraries/Zigbee/src/ep/ZigbeeTempSensor.h

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class ZigbeeTempSensor : public ZigbeeEP {
4646

4747
private:
4848
bool _humidity_sensor;
49-
5049
};
5150

52-
5351
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

0 commit comments

Comments
 (0)