The topic or array of topics to which the handler should respond.
Optional conditionA conditional function that determines whether the handler should be invoked based on the received payload and the Kos Data Model instance. If not provided, the handler will always be invoked when a matching topic is received.
The transformed payload received from the topic.
The Kos Data Model instance to which the topic handler belongs.
true if the handler should be invoked, false otherwise.
Optional transformA transformation function that converts the raw response payload into a desired format. If not provided, the payload will be used as is.
The raw response payload received from the topic.
The transformed payload in the desired format.
Optional websocketIndicates whether the topic handler should listen for WebSocket messages.
If set to true, the handler will be invoked when WebSocket messages with matching topics are received.
Default is false.
Configuration parameters for defining a Kos topic handler function within a Kos Data Model class.
Typeparam
Response - The type of the raw response payload received from the topic.
Typeparam
Model - The type of the Kos Data Model to which the topic handler belongs.
Typeparam
TransformedResponse - The type of the transformed response payload after applying the transformation function.