[deconz] color temperature channel improvements (#17777)

Signed-off-by: AndrewFG <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2024-11-24 00:03:29 +00:00 committed by GitHub
parent c758013093
commit 61e9413cdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 23 additions and 17 deletions

View File

@ -179,7 +179,7 @@ Other devices support
| brightness | Dimmer | R/W | Brightness of the light | `dimmablelight`, `colortemperaturelight` | | brightness | Dimmer | R/W | Brightness of the light | `dimmablelight`, `colortemperaturelight` |
| switch | Switch | R/W | State of a ON/OFF device | `onofflight` | | 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 | 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` | | effect | String | R/W | Effect selection. Allowed commands are set dynamically | `colorlight` |
| effectSpeed | Number | W | Effect Speed | `colorlight` | | effectSpeed | Number | W | Effect Speed | `colorlight` |
| lock | Switch | R/W | Lock (ON) or unlock (OFF) the doorlock | `doorlock` | | lock | Switch | R/W | Lock (ON) or unlock (OFF) the doorlock | `doorlock` |

View File

@ -123,6 +123,7 @@ public class LightThingHandler extends DeconzBaseThingHandler {
// minimum and maximum are inverted due to mired/kelvin conversion! // minimum and maximum are inverted due to mired/kelvin conversion!
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create() StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withStep(BigDecimal.valueOf(100)).withPattern("%.0f K")
.withMinimum(new BigDecimal(miredToKelvin(ctMax))) .withMinimum(new BigDecimal(miredToKelvin(ctMax)))
.withMaximum(new BigDecimal(miredToKelvin(ctMin))).build(); .withMaximum(new BigDecimal(miredToKelvin(ctMin))).build();
stateDescriptionProvider.setDescriptionFragment( stateDescriptionProvider.setDescriptionFragment(

View File

@ -113,8 +113,6 @@ channel-type.deconz.carbonmonoxide.label = Carbon-monoxide
channel-type.deconz.carbonmonoxide.description = Carbon-monoxide was detected. channel-type.deconz.carbonmonoxide.description = Carbon-monoxide was detected.
channel-type.deconz.consumption.label = Consumption channel-type.deconz.consumption.label = Consumption
channel-type.deconz.consumption.description = Current 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.label = Current
channel-type.deconz.current.description = Current current channel-type.deconz.current.description = Current current
channel-type.deconz.dark.label = Dark channel-type.deconz.dark.label = Dark

View File

@ -15,12 +15,12 @@
<channel typeId="any_on" id="any_on"/> <channel typeId="any_on" id="any_on"/>
<channel typeId="alert" id="alert"/> <channel typeId="alert" id="alert"/>
<channel typeId="system.color" id="color"/> <channel typeId="system.color" id="color"/>
<channel typeId="ct" id="color_temperature"/> <channel typeId="system.color-temperature-abs" id="color_temperature"/>
<channel typeId="scene" id="scene"/> <channel typeId="scene" id="scene"/>
</channels> </channels>
<properties> <properties>
<property name="thingTypeVersion">1</property> <property name="thingTypeVersion">2</property>
</properties> </properties>
<representation-property>uid</representation-property> <representation-property>uid</representation-property>

View File

@ -87,13 +87,13 @@
<category>Lightbulb</category> <category>Lightbulb</category>
<channels> <channels>
<channel typeId="system.brightness" id="brightness"/> <channel typeId="system.brightness" id="brightness"/>
<channel typeId="ct" id="color_temperature"/> <channel typeId="system.color-temperature-abs" id="color_temperature"/>
<channel typeId="ontime" id="ontime"/> <channel typeId="ontime" id="ontime"/>
<channel typeId="alert" id="alert"/> <channel typeId="alert" id="alert"/>
</channels> </channels>
<properties> <properties>
<property name="thingTypeVersion">1</property> <property name="thingTypeVersion">2</property>
</properties> </properties>
<representation-property>uid</representation-property> <representation-property>uid</representation-property>
@ -132,13 +132,13 @@
<category>Lightbulb</category> <category>Lightbulb</category>
<channels> <channels>
<channel typeId="system.color" id="color"/> <channel typeId="system.color" id="color"/>
<channel typeId="ct" id="color_temperature"/> <channel typeId="system.color-temperature-abs" id="color_temperature"/>
<channel typeId="ontime" id="ontime"/> <channel typeId="ontime" id="ontime"/>
<channel typeId="alert" id="alert"/> <channel typeId="alert" id="alert"/>
</channels> </channels>
<properties> <properties>
<property name="thingTypeVersion">1</property> <property name="thingTypeVersion">2</property>
</properties> </properties>
<representation-property>uid</representation-property> <representation-property>uid</representation-property>
@ -169,14 +169,6 @@
<state pattern="%.1f %%"/> <state pattern="%.1f %%"/>
</channel-type> </channel-type>
<channel-type id="ct">
<item-type>Number</item-type>
<label>Color Temperature</label>
<description>Controls the color temperature of the light in Kelvin</description>
<category>ColorLight</category>
<state pattern="%.0f K" min="1000" max="10000"/>
</channel-type>
<channel-type id="ontime"> <channel-type id="ontime">
<item-type>Number:Time</item-type> <item-type>Number:Time</item-type>
<label>On Time</label> <label>On Time</label>

View File

@ -33,6 +33,11 @@
<type>system:brightness</type> <type>system:brightness</type>
</update-channel> </update-channel>
</instruction-set> </instruction-set>
<instruction-set targetVersion="2">
<update-channel id="color_temperature">
<type>system:color-temperature-abs</type>
</update-channel>
</instruction-set>
</thing-type> </thing-type>
<thing-type uid="deconz:dimmablelight"> <thing-type uid="deconz:dimmablelight">
@ -49,6 +54,11 @@
<type>system:color</type> <type>system:color</type>
</update-channel> </update-channel>
</instruction-set> </instruction-set>
<instruction-set targetVersion="2">
<update-channel id="color_temperature">
<type>system:color-temperature-abs</type>
</update-channel>
</instruction-set>
</thing-type> </thing-type>
<thing-type uid="deconz:lightgroup"> <thing-type uid="deconz:lightgroup">
@ -57,6 +67,11 @@
<type>system:color</type> <type>system:color</type>
</update-channel> </update-channel>
</instruction-set> </instruction-set>
<instruction-set targetVersion="2">
<update-channel id="color_temperature">
<type>system:color-temperature-abs</type>
</update-channel>
</instruction-set>
</thing-type> </thing-type>
<thing-type uid="deconz:onofflight"> <thing-type uid="deconz:onofflight">