File tree 1 file changed +18
-3
lines changed
src/adapter/deconz/adapter
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -380,9 +380,24 @@ export class DeconzAdapter extends Adapter {
380
380
const responseClusterId = Zdo . Utils . getResponseClusterId ( clusterId ) ;
381
381
382
382
if ( responseClusterId ) {
383
- const response = await this . waitForData ( isNwkAddrRequest ? ieeeAddress : networkAddress , Zdo . ZDO_PROFILE_ID , responseClusterId ) ;
384
-
385
- return response . zdo ! as ZdoTypes . RequestToResponseMap [ K ] ;
383
+ try {
384
+ const response = await this . waitForData ( isNwkAddrRequest ? ieeeAddress : networkAddress , Zdo . ZDO_PROFILE_ID , responseClusterId ) ;
385
+ return response . zdo ! as ZdoTypes . RequestToResponseMap [ K ] ;
386
+ } catch ( error ) {
387
+ if ( responseClusterId == Zdo . ClusterId . ACTIVE_ENDPOINTS_RESPONSE && networkAddress === 0 ) {
388
+ logger . warning ( 'Failed to determine active endpoints of coordinator, falling back to [1]' , NS ) ;
389
+ // Some Conbee adapaters don't provide a response to an active endpoint request of the coordinator, always return
390
+ // an endpoint here. Before an active endpoint request was done to determine the endpoints, they were hardcoded:
391
+ // https://github.com/Koenkk/zigbee-herdsman/blob/d855b3bf85a066cb7c325fe3ef0006873c735add/src/adapter/deconz/adapter/deconzAdapter.ts#L105
392
+ const response : ZdoTypes . ResponseMap [ Zdo . ClusterId . ACTIVE_ENDPOINTS_RESPONSE ] = [
393
+ Zdo . Status . SUCCESS ,
394
+ { endpointList : [ 1 ] , nwkAddress : 0 } ,
395
+ ] ;
396
+ return response as ZdoTypes . RequestToResponseMap [ K ] ;
397
+ } else {
398
+ throw error ;
399
+ }
400
+ }
386
401
}
387
402
}
388
403
}
You can’t perform that action at this time.
0 commit comments