Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Saavedra Vaz <[email protected]>
  • Loading branch information
P-R-O-C-H-Y and lucasssvaz authored Dec 13, 2024
1 parent 57339ba commit a7e2e64
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max
if(delta > 0) {
log_e("Delta reporting is currently not supported by the carbon dioxide sensor");
}
// clang-format off
esp_zb_zcl_reporting_info_t reporting_info = {
.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV,
.ep = _endpoint,
Expand All @@ -72,6 +73,7 @@ void ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max
},
.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC,
};
// clang-format on
esp_zb_lock_acquire(portMAX_DELAY);
esp_zb_zcl_update_reporting_info(&reporting_info);
esp_zb_lock_release();
Expand Down
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ZigbeeEP.h"
#include "ha/esp_zigbee_ha_standard.h"

// clang-format off
#define ZIGBEE_DEFAULT_CARBON_DIOXIDE_SENSOR_CONFIG() \
{ \
.basic_cfg = \
Expand All @@ -27,6 +28,7 @@
.max_measured_value = 1.0, \
}, \
}
// clang-format on

typedef struct zigbee_carbon_dioxide_sensor_cfg_s {
esp_zb_basic_cluster_cfg_t basic_cfg;
Expand Down
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void ZigbeeFlowSensor::setTolerance(float tolerance) {
}

void ZigbeeFlowSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) {
// clang-format off
esp_zb_zcl_reporting_info_t reporting_info = {
.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV,
.ep = _endpoint,
Expand All @@ -70,6 +71,7 @@ void ZigbeeFlowSensor::setReporting(uint16_t min_interval, uint16_t max_interval
},
.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC,
};
// clang-format on
esp_zb_lock_acquire(portMAX_DELAY);
esp_zb_zcl_update_reporting_info(&reporting_info);
esp_zb_lock_release();
Expand Down
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeeFlowSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ZigbeeEP.h"
#include "ha/esp_zigbee_ha_standard.h"

// clang-format off
#define ZIGBEE_DEFAULT_FLOW_SENSOR_CONFIG() \
{ \
.basic_cfg = \
Expand All @@ -27,6 +28,7 @@
.max_value = 0x7FFF, \
}, \
}
// clang-format on

typedef struct zigbee_flow_sensor_cfg_s {
esp_zb_basic_cluster_cfg_t basic_cfg;
Expand Down
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeeOccupancySensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ZigbeeEP.h"
#include "ha/esp_zigbee_ha_standard.h"

// clang-format off
#define ZIGBEE_DEFAULT_OCCUPANCY_SENSOR_CONFIG() \
{ \
.basic_cfg = \
Expand All @@ -27,6 +28,7 @@
.sensor_type_bitmap = (1 << ESP_ZB_ZCL_OCCUPANCY_SENSING_OCCUPANCY_SENSOR_TYPE_PIR), \
}, \
}
// clang-format on

typedef struct zigbee_occupancy_sensor_cfg_s {
esp_zb_basic_cluster_cfg_t basic_cfg;
Expand Down
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void ZigbeePressureSensor::setTolerance(uint16_t tolerance) {
}

void ZigbeePressureSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) {
// clang-format off
esp_zb_zcl_reporting_info_t reporting_info = {
.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV,
.ep = _endpoint,
Expand All @@ -67,6 +68,7 @@ void ZigbeePressureSensor::setReporting(uint16_t min_interval, uint16_t max_inte
},
.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC,
};
// clang-format on
esp_zb_lock_acquire(portMAX_DELAY);
esp_zb_zcl_update_reporting_info(&reporting_info);
esp_zb_lock_release();
Expand Down
2 changes: 2 additions & 0 deletions libraries/Zigbee/src/ep/ZigbeePressureSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ZigbeeEP.h"
#include "ha/esp_zigbee_ha_standard.h"

// clang-format off
#define ZIGBEE_DEFAULT_PRESSURE_SENSOR_CONFIG() \
{ \
.basic_cfg = \
Expand All @@ -27,6 +28,7 @@
.max_value = ESP_ZB_ZCL_PATTR_RESSURE_MEASUREMENT_MAX_VALUE_DEFAULT_VALUE, \
}, \
}
// clang-format on

typedef struct zigbee_pressure_sensor_cfg_s {
esp_zb_basic_cluster_cfg_t basic_cfg;
Expand Down

0 comments on commit a7e2e64

Please sign in to comment.