From b607e49145721ae0a65b129637664f31a95db3e5 Mon Sep 17 00:00:00 2001 From: tiagohm Date: Tue, 27 Aug 2024 09:32:27 -0300 Subject: [PATCH] [api]: Create LightBoxDeserializer class --- .../api/lightboxes/LightBoxDeserializer.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 api/src/main/kotlin/nebulosa/api/lightboxes/LightBoxDeserializer.kt diff --git a/api/src/main/kotlin/nebulosa/api/lightboxes/LightBoxDeserializer.kt b/api/src/main/kotlin/nebulosa/api/lightboxes/LightBoxDeserializer.kt new file mode 100644 index 000000000..b5fd818c5 --- /dev/null +++ b/api/src/main/kotlin/nebulosa/api/lightboxes/LightBoxDeserializer.kt @@ -0,0 +1,16 @@ +package nebulosa.api.lightboxes + +import nebulosa.api.connection.ConnectionService +import nebulosa.api.devices.DeviceDeserializer +import nebulosa.indi.device.lightbox.LightBox +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.context.annotation.Lazy +import org.springframework.stereotype.Component + +@Component +class LightBoxDeserializer : DeviceDeserializer(LightBox::class.java) { + + @Autowired @Lazy private lateinit var connectionService: ConnectionService + + override fun deviceFor(name: String) = connectionService.lightBox(name) +}