This library allows a Kotlin/JVM or Kotlin/JS client to communicate with an AnimatedLEDStrip server.
To create a HTTP client, run ALSHttpClient(clientEngine, ip)
.
clientEngine
is a KtorHttpClientEngineFactory
val client = ALSHttpClient(CIO, ip = "10.0.0.254")
An optional configuration for the Ktor engine can be passed as a third argument. Any configuration should include a JSON feature that uses the AnimatedLEDStrip serializer:
import animatedledstrip.communication.serializer as alsSerializer
install(JsonFeature) {
serializer = KotlinxSerializer(alsSerializer)
}
This library follows the conventions laid out for AnimatedLEDStrip client libraries.