-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add better APIs for initializing MTRCluster instances from Swift. (#2…
- Loading branch information
1 parent
9ff8254
commit 954fff0
Showing
8 changed files
with
788 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/darwin/Framework/CHIP/templates/MTRClusters-swift.zapt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{> header excludeZapComment=true}} | ||
|
||
private let clusterQueue = DispatchQueue(label: "MTRCluster completion dispatch") | ||
|
||
{{#zcl_clusters}} | ||
{{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} | ||
{{swiftAvailability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="Future"}} | ||
extension MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} { | ||
public convenience init(device : MTRDevice, endpointID: UInt) { | ||
self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! | ||
} | ||
} | ||
|
||
{{/if}} | ||
{{/zcl_clusters}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.