From 61e9413cdc229fb2217224b6ab33bec5b2c14215 Mon Sep 17 00:00:00 2001 From: Andrew Fiddian-Green Date: Sun, 24 Nov 2024 00:03:29 +0000 Subject: [PATCH] [deconz] color temperature channel improvements (#17777) Signed-off-by: AndrewFG --- bundles/org.openhab.binding.deconz/README.md | 2 +- .../internal/handler/LightThingHandler.java | 1 + .../main/resources/OH-INF/i18n/deconz.properties | 2 -- .../resources/OH-INF/thing/group-thing-types.xml | 4 ++-- .../resources/OH-INF/thing/light-thing-types.xml | 16 ++++------------ .../src/main/resources/OH-INF/update/update.xml | 15 +++++++++++++++ 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/bundles/org.openhab.binding.deconz/README.md b/bundles/org.openhab.binding.deconz/README.md index 4103a35f070..c7c73a84283 100644 --- a/bundles/org.openhab.binding.deconz/README.md +++ b/bundles/org.openhab.binding.deconz/README.md @@ -179,7 +179,7 @@ Other devices support | brightness | Dimmer | R/W | Brightness of the light | `dimmablelight`, `colortemperaturelight` | | switch | Switch | R/W | State of a ON/OFF device | `onofflight` | | color | Color | R/W | Color of an multi-color light | `colorlight`, `extendedcolorlight`, `lightgroup` | -| color_temperature | Number | R/W | Color temperature in Kelvin. The value range is determined by each individual light | `colortemperaturelight`, `extendedcolorlight`, `lightgroup` | +| color_temperature | Number:Temperature | R/W | Color temperature in Kelvin. The value range is determined by each individual light | `colortemperaturelight`, `extendedcolorlight`, `lightgroup` | | effect | String | R/W | Effect selection. Allowed commands are set dynamically | `colorlight` | | effectSpeed | Number | W | Effect Speed | `colorlight` | | lock | Switch | R/W | Lock (ON) or unlock (OFF) the doorlock | `doorlock` | diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java index 9c408369fcb..2e035dd1374 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/LightThingHandler.java @@ -123,6 +123,7 @@ public class LightThingHandler extends DeconzBaseThingHandler { // minimum and maximum are inverted due to mired/kelvin conversion! StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create() + .withStep(BigDecimal.valueOf(100)).withPattern("%.0f K") .withMinimum(new BigDecimal(miredToKelvin(ctMax))) .withMaximum(new BigDecimal(miredToKelvin(ctMin))).build(); stateDescriptionProvider.setDescriptionFragment( diff --git a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/i18n/deconz.properties b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/i18n/deconz.properties index 1cf05de8bb1..3011c782e2d 100644 --- a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/i18n/deconz.properties +++ b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/i18n/deconz.properties @@ -113,8 +113,6 @@ channel-type.deconz.carbonmonoxide.label = Carbon-monoxide channel-type.deconz.carbonmonoxide.description = Carbon-monoxide was detected. channel-type.deconz.consumption.label = Consumption channel-type.deconz.consumption.description = Current consumption -channel-type.deconz.ct.label = Color Temperature -channel-type.deconz.ct.description = Controls the color temperature of the light in Kelvin channel-type.deconz.current.label = Current channel-type.deconz.current.description = Current current channel-type.deconz.dark.label = Dark diff --git a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/group-thing-types.xml b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/group-thing-types.xml index df389ed9eb0..30527ae74ce 100644 --- a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/group-thing-types.xml +++ b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/group-thing-types.xml @@ -15,12 +15,12 @@ - + - 1 + 2 uid diff --git a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/light-thing-types.xml b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/light-thing-types.xml index 7130c614874..89feb5d1bbc 100644 --- a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/light-thing-types.xml +++ b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/thing/light-thing-types.xml @@ -87,13 +87,13 @@ Lightbulb - + - 1 + 2 uid @@ -132,13 +132,13 @@ Lightbulb - + - 1 + 2 uid @@ -169,14 +169,6 @@ - - Number - - Controls the color temperature of the light in Kelvin - ColorLight - - - Number:Time diff --git a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/update/update.xml b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/update/update.xml index e4639b0ad1d..a16b2301787 100644 --- a/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/update/update.xml +++ b/bundles/org.openhab.binding.deconz/src/main/resources/OH-INF/update/update.xml @@ -33,6 +33,11 @@ system:brightness + + + system:color-temperature-abs + + @@ -49,6 +54,11 @@ system:color + + + system:color-temperature-abs + + @@ -57,6 +67,11 @@ system:color + + + system:color-temperature-abs + +