Skip to content

Commit d897c77

Browse files
committed
More accurate availability and hang on to BrowserProxy after starting a scan
1 parent cb2e001 commit d897c77

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Sources/HMAcessoryBrowser+Promise.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public class HMPromiseAccessoryBrowser {
1010
private var proxy: BrowserProxy?
1111

1212
public func start(scanInterval: ScanInterval) -> Promise<[HMAccessory]> {
13-
return BrowserProxy(scanInterval: scanInterval).promise
13+
proxy = BrowserProxy(scanInterval: scanInterval)
14+
return proxy!.promise
1415
}
1516

1617
public func stop() {

Sources/HMHome+Promise.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extension HMHome {
1313

1414
#if !os(tvOS) && swift(>=3.2)
1515
/// Add and setup a new HMAccessory. Displays it's own UI
16-
@available(iOS 11.3, OSX 10.13, watchOS 4.0, *)
16+
@available(iOS 11.3, *)
1717
public func addAndSetupAccessories(with payload: HMAccessorySetupPayload) -> Promise<[HMAccessory]> {
1818
return Promise { seal in
1919
self.addAndSetupAccessories(with: payload, completionHandler: seal.resolve)

0 commit comments

Comments
 (0)