Fix disconnect issues (hopefully)
This commit is contained in:
@@ -57,6 +57,9 @@ class HomeAssistantServer: Server
|
||||
}
|
||||
|
||||
func disconnect(_ completion: ((any Error)?) -> Void) {
|
||||
self.eventTask?.cancel()
|
||||
self.eventTask = nil
|
||||
|
||||
Task { await liaison.disconnect() }
|
||||
completion(nil)
|
||||
}
|
||||
@@ -202,7 +205,7 @@ class HomeAssistantServer: Server
|
||||
device.state = switch event.data.newState.state {
|
||||
case .on: .on
|
||||
case .off: .off
|
||||
case .other(let string): .off
|
||||
case .other(_): .off
|
||||
}
|
||||
|
||||
delegate?.server(self, deviceChangedState: device.eraseToAnyDevice())
|
||||
|
||||
Reference in New Issue
Block a user