Skip to content

Commit 8560ff3

Browse files
committed
fix(zigbee): Hope its finished now..
1 parent 1f60c92 commit 8560ff3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ bool ZigbeeDoorWindowHandle::setClosed() {
4343
return false;
4444
}
4545
_zone_status = closed;
46-
report();
47-
return true;
46+
return report();
4847
}
4948

5049
bool ZigbeeDoorWindowHandle::setOpen() {
@@ -61,8 +60,7 @@ bool ZigbeeDoorWindowHandle::setOpen() {
6160
return false;
6261
}
6362
_zone_status = open;
64-
report();
65-
return true;
63+
return report();
6664
}
6765

6866
bool ZigbeeDoorWindowHandle::setTilted() {
@@ -79,12 +77,10 @@ bool ZigbeeDoorWindowHandle::setTilted() {
7977
return false;
8078
}
8179
_zone_status = tilted;
82-
report();
83-
return true;
80+
return report();
8481
}
8582

86-
//NOTE: Change to return bool as a result of esp_zb_zcl_ias_zone_status_change_notif_cmd_req()
87-
void ZigbeeDoorWindowHandle::report() {
83+
bool ZigbeeDoorWindowHandle::report() {
8884
/* Send IAS Zone status changed notification command */
8985

9086
esp_zb_zcl_ias_zone_status_change_notif_cmd_t status_change_notif_cmd;
@@ -98,10 +94,12 @@ void ZigbeeDoorWindowHandle::report() {
9894
status_change_notif_cmd.zone_id = _zone_id;
9995
status_change_notif_cmd.delay = 0;
10096

97+
//NOTE: Check result of esp_zb_zcl_ias_zone_status_change_notif_cmd_req() and return true if success, false if failure
10198
esp_zb_lock_acquire(portMAX_DELAY);
10299
esp_zb_zcl_ias_zone_status_change_notif_cmd_req(&status_change_notif_cmd);
103100
esp_zb_lock_release();
104101
log_v("IAS Zone status changed notification sent");
102+
return true;
105103
}
106104

107105
void ZigbeeDoorWindowHandle::zbIASZoneEnrollResponse(const esp_zb_zcl_ias_zone_enroll_response_message_t *message) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ZigbeeDoorWindowHandle : public ZigbeeEP {
5858
bool setTilted();
5959

6060
// Report the door/window handle value, done automatically after setting the position
61-
void report();
61+
bool report();
6262

6363
private:
6464
void zbIASZoneEnrollResponse(const esp_zb_zcl_ias_zone_enroll_response_message_t *message) override;

0 commit comments

Comments
 (0)