Skip to content

Commit

Permalink
Release 1.2.1
Browse files Browse the repository at this point in the history
• Update Device List
• MultiUser Switch
• Bug Fixes
  • Loading branch information
androidseb25 committed Oct 31, 2023
1 parent 5e459ed commit 33eda9e
Show file tree
Hide file tree
Showing 22 changed files with 879 additions and 733 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions HealthcheckIntents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<array/>
<key>IntentsSupported</key>
<array>
<string>ConfigurationFourIntent</string>
<string>ConfigurationIntent</string>
</array>
</dict>
Expand Down
127 changes: 125 additions & 2 deletions HealthcheckIntents/IntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class IntentHandler: INExtension, ConfigurationIntentHandling {

let shrinkedEventList = hcr.domain.sorted { $0.name > $1.name }
shrinkedEventList.forEach { health in
var healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
let healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
healthStatus.events = []
health.events.forEach { e in
let event = EventSymbol(identifier: UUID().uuidString, display: e.status!.formatted())
Expand Down Expand Up @@ -54,7 +54,130 @@ class IntentHandler: INExtension, ConfigurationIntentHandling {

let shrinkedEventList = hcr.domain.sorted { $0.name > $1.name }
shrinkedEventList.forEach { health in
var healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
let healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
healthStatus.events = []
health.events.forEach { e in
let event = EventSymbol(identifier: UUID().uuidString, display: e.status!.formatted())
healthStatus.events?.append(event)
}

symbols.append(healthStatus)
}
// Create a collection with the array of characters.
let collection = INObjectCollection(items: symbols)
print("Collection")
// Call the completion handler, passing the collection.
return collection
}

}

class IntentFourHandler: INExtension, ConfigurationFourIntentHandling {

func resolveHealthcheckSymbol11(for intent: ConfigurationFourIntent) async -> HealthcheckSymbolResolutionResult {
return .success(with: HealthcheckSymbol(identifier: "", display: ""))
}

func provideHealthcheckSymbol11OptionsCollection(for intent: ConfigurationFourIntent) async throws -> INObjectCollection<HealthcheckSymbol> {
var symbols:[HealthcheckSymbol] = []

let api = NetworkServices()
let hcd = DummyData.HealthcheckListCustom(customCount: 4)
let hcr = await api.GetHealthchecks() ?? HealthCheckResult(domain: hcd)

let shrinkedEventList = hcr.domain.sorted { $0.name > $1.name }
shrinkedEventList.forEach { health in
let healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
healthStatus.events = []
health.events.forEach { e in
let event = EventSymbol(identifier: UUID().uuidString, display: e.status!.formatted())
healthStatus.events?.append(event)
}

symbols.append(healthStatus)
}
// Create a collection with the array of characters.
let collection = INObjectCollection(items: symbols)
print("Collection")
// Call the completion handler, passing the collection.
return collection
}

func resolveHealthcheckSymbol12(for intent: ConfigurationFourIntent) async -> HealthcheckSymbolResolutionResult {
return .success(with: HealthcheckSymbol(identifier: "", display: ""))
}


func provideHealthcheckSymbol12OptionsCollection(for intent: ConfigurationFourIntent) async throws -> INObjectCollection<HealthcheckSymbol> {
var symbols:[HealthcheckSymbol] = []

let api = NetworkServices()
let hcd = DummyData.HealthcheckListCustom(customCount: 4)
let hcr = await api.GetHealthchecks() ?? HealthCheckResult(domain: hcd)

let shrinkedEventList = hcr.domain.sorted { $0.name > $1.name }
shrinkedEventList.forEach { health in
let healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
healthStatus.events = []
health.events.forEach { e in
let event = EventSymbol(identifier: UUID().uuidString, display: e.status!.formatted())
healthStatus.events?.append(event)
}

symbols.append(healthStatus)
}
// Create a collection with the array of characters.
let collection = INObjectCollection(items: symbols)
print("Collection")
// Call the completion handler, passing the collection.
return collection
}

func resolveHealthcheckSymbol21(for intent: ConfigurationFourIntent) async -> HealthcheckSymbolResolutionResult {
return .success(with: HealthcheckSymbol(identifier: "", display: ""))
}


func provideHealthcheckSymbol21OptionsCollection(for intent: ConfigurationFourIntent) async throws -> INObjectCollection<HealthcheckSymbol> {
var symbols:[HealthcheckSymbol] = []

let api = NetworkServices()
let hcd = DummyData.HealthcheckListCustom(customCount: 4)
let hcr = await api.GetHealthchecks() ?? HealthCheckResult(domain: hcd)

let shrinkedEventList = hcr.domain.sorted { $0.name > $1.name }
shrinkedEventList.forEach { health in
let healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
healthStatus.events = []
health.events.forEach { e in
let event = EventSymbol(identifier: UUID().uuidString, display: e.status!.formatted())
healthStatus.events?.append(event)
}

symbols.append(healthStatus)
}
// Create a collection with the array of characters.
let collection = INObjectCollection(items: symbols)
print("Collection")
// Call the completion handler, passing the collection.
return collection
}

func resolveHealthcheckSymbol22(for intent: ConfigurationFourIntent) async -> HealthcheckSymbolResolutionResult {
return .success(with: HealthcheckSymbol(identifier: "", display: ""))
}


func provideHealthcheckSymbol22OptionsCollection(for intent: ConfigurationFourIntent) async throws -> INObjectCollection<HealthcheckSymbol> {
var symbols:[HealthcheckSymbol] = []

let api = NetworkServices()
let hcd = DummyData.HealthcheckListCustom(customCount: 4)
let hcr = await api.GetHealthchecks() ?? HealthCheckResult(domain: hcd)

let shrinkedEventList = hcr.domain.sorted { $0.name > $1.name }
shrinkedEventList.forEach { health in
let healthStatus = HealthcheckSymbol(identifier: health.healthtoken, display: health.name)
healthStatus.events = []
health.events.forEach { e in
let event = EventSymbol(identifier: UUID().uuidString, display: e.status!.formatted())
Expand Down
Loading

0 comments on commit 33eda9e

Please sign in to comment.