-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ChaosCoder/feature/triggersAndActionSets
Add methods for action sets and triggers
- Loading branch information
Showing
5 changed files
with
138 additions
and
4 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
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,26 @@ | ||
import Foundation | ||
import HomeKit | ||
#if !PMKCocoaPods | ||
import PromiseKit | ||
#endif | ||
|
||
#if !os(tvOS) && !os(watchOS) | ||
|
||
extension HMActionSet { | ||
|
||
@available(iOS 8.0, *) | ||
public func addAction(_ action: HMAction) -> Promise<Void> { | ||
return Promise { seal in | ||
self.addAction(action, completionHandler: seal.resolve) | ||
} | ||
} | ||
|
||
@available(iOS 8.0, *) | ||
public func updateName(_ name: String) -> Promise<Void> { | ||
return Promise { seal in | ||
self.updateName(name, completionHandler: seal.resolve) | ||
} | ||
} | ||
} | ||
|
||
#endif |
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,21 @@ | ||
import Foundation | ||
import HomeKit | ||
#if !PMKCocoaPods | ||
import PromiseKit | ||
#endif | ||
|
||
#if !os(tvOS) && !os(watchOS) | ||
|
||
@available(iOS 9.0, *) | ||
extension HMEventTrigger { | ||
|
||
@available(iOS 11.0, *) | ||
public func updateExecuteOnce(_ executeOnce: Bool) -> Promise<Void> { | ||
return Promise { seal in | ||
self.updateExecuteOnce(executeOnce, completionHandler: seal.resolve) | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Foundation | ||
import HomeKit | ||
#if !PMKCocoaPods | ||
import PromiseKit | ||
#endif | ||
|
||
#if !os(tvOS) && !os(watchOS) | ||
|
||
extension HMTrigger { | ||
|
||
@available(iOS 8.0, *) | ||
public func updateName(_ name: String) -> Promise<Void> { | ||
return Promise { seal in | ||
self.updateName(name, completionHandler: seal.resolve) | ||
} | ||
} | ||
|
||
@available(iOS 8.0, *) | ||
public func enable(_ enabled: Bool) -> Promise<Void> { | ||
return Promise { seal in | ||
self.enable(enabled, completionHandler: seal.resolve) | ||
} | ||
} | ||
|
||
@available(iOS 8.0, *) | ||
public func addActionSet(_ actionSet: HMActionSet) -> Promise<Void> { | ||
return Promise { seal in | ||
self.addActionSet(actionSet, completionHandler: seal.resolve) | ||
} | ||
} | ||
|
||
@available(iOS 8.0, *) | ||
public func removeActionSet(_ actionSet: HMActionSet) -> Promise<Void> { | ||
return Promise { seal in | ||
self.removeActionSet(actionSet, completionHandler: seal.resolve) | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |