Skip to content

Commit 03fff97

Browse files
P-R-O-C-H-YCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent a8be5fb commit 03fff97

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

libraries/Zigbee/examples/Zigbee_Binary_Input/Zigbee_Binary_Input.ino

+3-12
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
// limitations under the License.
1414

1515
/**
16-
* @brief This example demonstrates Zigbee analog input / output device.
16+
* @brief This example demonstrates Zigbee binary input device.
1717
*
18-
* The example demonstrates how to use Zigbee library to create a end device analog device.
18+
* The example demonstrates how to use Zigbee library to create an end device binary sensor device.
1919
*
2020
* Proper Zigbee mode must be selected in Tools->Zigbee mode
2121
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
2222
*
2323
* Please check the README.md for instructions and more detailed description.
2424
*
2525
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
26-
* Modified by Pat Clay
2726
*/
2827

2928
#ifndef ZIGBEE_MODE_ED
@@ -32,7 +31,7 @@
3231

3332
#include "Zigbee.h"
3433

35-
/* Zigbee analog device configuration */
34+
/* Zigbee binary sensor device configuration */
3635
#define BINARY_DEVICE_ENDPOINT_NUMBER 1
3736

3837
uint8_t binaryPin = A0;
@@ -43,10 +42,6 @@ ZigbeeBinary zbBinaryZone = ZigbeeBinary(BINARY_DEVICE_ENDPOINT_NUMBER + 1);
4342

4443
bool binaryStatus = false;
4544

46-
void onAnalogOutputChange(float analog_output) {
47-
Serial.printf("Received analog output change: %.1f\r\n", analog_output);
48-
}
49-
5045
void setup() {
5146
Serial.begin(115200);
5247
Serial.println("Starting...");
@@ -89,10 +84,6 @@ void setup() {
8984
delay(100);
9085
}
9186
Serial.println("Connected");
92-
93-
// // Optional: Add reporting for analog input
94-
// zbBinaryFan.setBinaryInputReporting(0, 30, 10); // report every 30 seconds if value changes by 10
95-
// zbBinaryZone.setBinaryInputReporting(0, 30, 10); // report every 30 seconds if value changes by 10
9687
}
9788

9889
void loop() {

libraries/Zigbee/src/ep/ZigbeeBinary.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bool ZigbeeBinary::setBinaryInputApplication(uint32_t application_type) {
5858
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BINARY_INPUT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
5959
esp_err_t ret = esp_zb_cluster_update_attr(binary_input_cluster, ESP_ZB_ZCL_ATTR_BINARY_INPUT_APPLICATION_TYPE_ID, (void *)&application_type_value);
6060
if (ret != ESP_OK) {
61-
log_e("Failed to set AI application type: 0x%x: %s", ret, esp_err_to_name(ret));
61+
log_e("Failed to set Binary Input application type: 0x%x: %s", ret, esp_err_to_name(ret));
6262
return false;
6363
}
6464
return true;

libraries/Zigbee/src/ep/ZigbeeBinary.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Class of Zigbee Analog sensor endpoint inherited from common EP class */
1+
/* Class of Zigbee Binary sensor endpoint inherited from common EP class */
22

33
#pragma once
44

0 commit comments

Comments
 (0)