Skip to content

Commit 6eed3db

Browse files
ci(pre-commit): Apply automatic fixes
1 parent ce941fe commit 6eed3db

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ bool ZigbeeEP::setBatteryPercentage(uint8_t percentage) {
128128
bool ZigbeeEP::setBatteryVoltage(uint8_t voltage) {
129129
esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS;
130130
esp_zb_lock_acquire(portMAX_DELAY);
131-
ret = esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID, &voltage, false);
131+
ret = esp_zb_zcl_set_attribute_val(
132+
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID, &voltage, false
133+
);
132134
esp_zb_lock_release();
133135
if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) {
134136
log_e("Failed to set battery voltage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret));

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ class ZigbeeEP {
7777
char *readModel(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_addr_t ieee_addr);
7878

7979
// Set Power source and battery percentage for battery powered devices
80-
bool setPowerSource(zb_power_source_t power_source, uint8_t percentage = 0xff, uint8_t voltage = 0xff); // voltage in 100mV
81-
bool setBatteryPercentage(uint8_t percentage); // 0-100 %
82-
bool setBatteryVoltage(uint8_t voltage); // voltage in 100mV (example value 35 for 3.5V)
83-
bool reportBatteryPercentage(); // battery voltage is not reportable attribute
80+
bool setPowerSource(zb_power_source_t power_source, uint8_t percentage = 0xff, uint8_t voltage = 0xff); // voltage in 100mV
81+
bool setBatteryPercentage(uint8_t percentage); // 0-100 %
82+
bool setBatteryVoltage(uint8_t voltage); // voltage in 100mV (example value 35 for 3.5V)
83+
bool reportBatteryPercentage(); // battery voltage is not reportable attribute
8484

8585
// Set time
8686
bool addTimeCluster(tm time = {}, int32_t gmt_offset = 0); // gmt offset in seconds

0 commit comments

Comments
 (0)