diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/controller/HybridStageRestController.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/controller/HybridStageRestController.kt index 8f22230..f7f117e 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/controller/HybridStageRestController.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/controller/HybridStageRestController.kt @@ -17,15 +17,15 @@ class HybridStageRestController( fun hexColor( @RequestParam(value = "ids", required = false, defaultValue = "") ids: String, @RequestParam(value = "hexColors") hexColors: String, - @RequestParam(value = "gains", required = false, defaultValue = "") gains: String, + @RequestParam(value = "gains", required = false, defaultValue = "1.0") gains: String, @RequestParam(value = "transition", required = false) transition: Long?, @RequestParam(value = "turnOn", required = false, defaultValue = "true") turnOn: Boolean, @RequestParam(value = "store", required = false, defaultValue = "true") store: Boolean, @RequestParam(value = "storeName", required = false) storeName: String? ) { hybridStageService.hexColor( - ids = ids.split(",").map { it.trim() }, - hexColors = hexColors.split(",").map { it.trim() }, + ids = ids.split(",").map { it.trim() }.filter { it.isNotEmpty() }, + hexColors = hexColors.split(",").map { it.trim() }.filter { it.isNotEmpty() }, gains = gains.split(",").map { it.toDouble() }, transition = transition, turnOn = turnOn, diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/scenes/controller/ScenesRestController.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/scenes/controller/ScenesRestController.kt index 510cc58..8038190 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/scenes/controller/ScenesRestController.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/scenes/controller/ScenesRestController.kt @@ -30,11 +30,11 @@ class ScenesRestController( fun hybrid( @RequestParam(value = "ids", required = false, defaultValue = "") ids: String, @RequestParam(value = "hexColors", required = false, defaultValue = "") hexColors: String, - @RequestParam(value = "gains", required = false, defaultValue = "") gains: String, + @RequestParam(value = "gains", required = false, defaultValue = "1.0") gains: String, ) { scenesService.hybrid( - ids = ids.split(",").map { it.trim() }, - hexColors = hexColors.split(",").map { it.trim() }, + ids = ids.split(",").map { it.trim() }.filter { it.isNotEmpty() }, + hexColors = hexColors.split(",").map { it.trim() }.filter { it.isNotEmpty() }, gains = gains.split(",").map { it.toDouble() }) } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/controller/ShellyRestController.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/controller/ShellyRestController.kt index caa0e10..1b74492 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/controller/ShellyRestController.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/controller/ShellyRestController.kt @@ -59,15 +59,15 @@ class ShellyRestController( fun hexColor( @RequestParam(value = "ids", required = false, defaultValue = "") ids: String, @RequestParam(value = "hexColors") hexColors: String, - @RequestParam(value = "gains", required = false, defaultValue = "") gains: String, + @RequestParam(value = "gains", required = false, defaultValue = "1.0") gains: String, @RequestParam(value = "transition", required = false) transitionDuration: Long?, @RequestParam(value = "turnOn", required = false, defaultValue = "true") turnOn: Boolean, @RequestParam(value = "store", required = false, defaultValue = "true") store: Boolean, @RequestParam(value = "storeName", required = false) storeName: String? ) { hybridStageService.hexColor( - ids = ids.split(",").map { it.trim() }, - hexColors = hexColors.split(",").map { it.trim() }, + ids = ids.split(",").map { it.trim() }.filter { it.isNotEmpty() }, + hexColors = hexColors.split(",").map { it.trim() }.filter { it.isNotEmpty() }, gains = gains.split(",").map { it.toDouble() }, transition = transitionDuration, turnOn = turnOn,