File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ bool ZigbeeDoorWindowHandle::setClosed() {
43
43
return false ;
44
44
}
45
45
_zone_status = closed;
46
- report ();
47
- return true ;
46
+ return report ();
48
47
}
49
48
50
49
bool ZigbeeDoorWindowHandle::setOpen () {
@@ -61,8 +60,7 @@ bool ZigbeeDoorWindowHandle::setOpen() {
61
60
return false ;
62
61
}
63
62
_zone_status = open ;
64
- report ();
65
- return true ;
63
+ return report ();
66
64
}
67
65
68
66
bool ZigbeeDoorWindowHandle::setTilted () {
@@ -79,12 +77,10 @@ bool ZigbeeDoorWindowHandle::setTilted() {
79
77
return false ;
80
78
}
81
79
_zone_status = tilted;
82
- report ();
83
- return true ;
80
+ return report ();
84
81
}
85
82
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 () {
88
84
/* Send IAS Zone status changed notification command */
89
85
90
86
esp_zb_zcl_ias_zone_status_change_notif_cmd_t status_change_notif_cmd;
@@ -98,10 +94,12 @@ void ZigbeeDoorWindowHandle::report() {
98
94
status_change_notif_cmd.zone_id = _zone_id;
99
95
status_change_notif_cmd.delay = 0 ;
100
96
97
+ // NOTE: Check result of esp_zb_zcl_ias_zone_status_change_notif_cmd_req() and return true if success, false if failure
101
98
esp_zb_lock_acquire (portMAX_DELAY);
102
99
esp_zb_zcl_ias_zone_status_change_notif_cmd_req (&status_change_notif_cmd);
103
100
esp_zb_lock_release ();
104
101
log_v (" IAS Zone status changed notification sent" );
102
+ return true ;
105
103
}
106
104
107
105
void ZigbeeDoorWindowHandle::zbIASZoneEnrollResponse (const esp_zb_zcl_ias_zone_enroll_response_message_t *message) {
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class ZigbeeDoorWindowHandle : public ZigbeeEP {
58
58
bool setTilted ();
59
59
60
60
// Report the door/window handle value, done automatically after setting the position
61
- void report ();
61
+ bool report ();
62
62
63
63
private:
64
64
void zbIASZoneEnrollResponse (const esp_zb_zcl_ias_zone_enroll_response_message_t *message) override ;
You can’t perform that action at this time.
0 commit comments