Skip to content

Commit

Permalink
getNearbyChargingSite added
Browse files Browse the repository at this point in the history
  • Loading branch information
andoma93 committed Nov 23, 2023
1 parent 951019f commit 82303e0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/Extensions/Combine/TeslaSwift+Combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ extension TeslaSwift {
}
}

public func getNearbyChargingSite(vehicle: Vehicle) -> Future<NearbyChargingSites, Error>{
Future { promise in
Task {
do {
let result = try await self.getNearbyChargingSites(vehicle)
promise(.success(result))
} catch let error {
promise(.failure(error))
}
}
}
}

public func getProducts() -> Future<[Product], Error> {
Future { promise in
Task {
Expand Down

0 comments on commit 82303e0

Please sign in to comment.