HATypedRequest
public struct HATypedRequest<ResponseType> where ResponseType : HADataDecodable
A request which has a strongly-typed response format
-
Create a typed request
Declaration
Swift
public init(request: HARequest)Parameters
requestThe request to be issued
-
The request to be issued
Declaration
Swift
public var request: HARequest -
Retrieve the current user
Declaration
Swift
static func currentUser() -> HATypedRequest<HAResponseCurrentUser>Return Value
A typed request that can be sent via
HAConnection -
Call a service
Note
Parameters areExpressibleByStringLiteral. You can use strings instead of using.init(rawValue:).Declaration
Swift
static func callService( domain: HAServicesDomain, service: HAServicesService, data: [String: Any] = [:] ) -> HATypedRequest<HAResponseVoid>Parameters
domainThe domain of the service, e.g.
lightserviceThe service, e.g.
turn_ondataThe service data
Return Value
A typed request that can be sent via
HAConnection -
Retrieve definition of all services
Declaration
Swift
static func getServices() -> HATypedRequest<HAResponseServices>Return Value
A typed request that can be sent via
HAConnection -
Send binary stream STT data
Declaration
Swift
static func sendSttData(sttHandlerId: UInt8, audioDataBase64Encoded: String) -> HATypedRequest<HAResponseVoid>Parameters
sttHandlerIdHandler Id provided by run-start event from Assist pipeline
audioDataBase64EncodedAudio data base 64 encoded
Return Value
A typed request that can be sent via
HAConnection
View on GitHub