@@ -64,16 +64,16 @@ bool ZigbeeBinary::setBinaryInputApplication(uint32_t application_type) {
6464 return true ;
6565}
6666
67- bool ZigbeeBinary::setBinaryInput (bool binary ) {
67+ bool ZigbeeBinary::setBinaryInput (bool input ) {
6868 esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS;
6969 if (!(_binary_clusters & BINARY_INPUT)) {
7070 log_e (" Binary Input cluster not added" );
7171 return false ;
7272 }
73- log_d (" Setting binary input to %d" , binary );
73+ log_d (" Setting binary input to %d" , input );
7474 esp_zb_lock_acquire (portMAX_DELAY);
7575 ret = esp_zb_zcl_set_attribute_val (
76- _endpoint, ESP_ZB_ZCL_CLUSTER_ID_BINARY_INPUT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_BINARY_INPUT_PRESENT_VALUE_ID, &binary , false
76+ _endpoint, ESP_ZB_ZCL_CLUSTER_ID_BINARY_INPUT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_BINARY_INPUT_PRESENT_VALUE_ID, &input , false
7777 );
7878 esp_zb_lock_release ();
7979 if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) {
@@ -104,32 +104,6 @@ bool ZigbeeBinary::reportBinaryInput() {
104104 return true ;
105105}
106106
107- bool ZigbeeBinary::setBinaryInputReporting (uint16_t min_interval, uint16_t max_interval, float delta) {
108- esp_zb_zcl_reporting_info_t reporting_info;
109- memset (&reporting_info, 0 , sizeof (esp_zb_zcl_reporting_info_t ));
110- reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV;
111- reporting_info.ep = _endpoint;
112- reporting_info.cluster_id = ESP_ZB_ZCL_CLUSTER_ID_BINARY_INPUT;
113- reporting_info.cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE;
114- reporting_info.attr_id = ESP_ZB_ZCL_ATTR_BINARY_INPUT_PRESENT_VALUE_ID;
115- reporting_info.u .send_info .min_interval = min_interval;
116- reporting_info.u .send_info .max_interval = max_interval;
117- reporting_info.u .send_info .def_min_interval = min_interval;
118- reporting_info.u .send_info .def_max_interval = max_interval;
119- reporting_info.u .send_info .delta .s32 = delta; // TODO: Check if this is correct
120- reporting_info.dst .profile_id = ESP_ZB_AF_HA_PROFILE_ID;
121- reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC;
122-
123- esp_zb_lock_acquire (portMAX_DELAY);
124- esp_err_t ret = esp_zb_zcl_update_reporting_info (&reporting_info);
125- esp_zb_lock_release ();
126- if (ret != ESP_OK) {
127- log_e (" Failed to set Binary Input reporting: 0x%x: %s" , ret, esp_err_to_name (ret));
128- return false ;
129- }
130- return true ;
131- }
132-
133107bool ZigbeeBinary::setBinaryInputDescription (const char *description) {
134108 if (!(_binary_clusters & BINARY_INPUT)) {
135109 log_e (" Binary Input cluster not added" );
0 commit comments