Skip to content

Commit

Permalink
[deconz] color temperature channel improvements (openhab#17777)
Browse files Browse the repository at this point in the history
Signed-off-by: AndrewFG <software@whitebear.ch>
  • Loading branch information
andrewfg authored and matchews committed Dec 16, 2024
1 parent d77efd7 commit 9dac7f8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.deconz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void initialize() {

// 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<channel typeId="any_on" id="any_on"/>
<channel typeId="alert" id="alert"/>
<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"/>
</channels>

<properties>
<property name="thingTypeVersion">1</property>
<property name="thingTypeVersion">2</property>
</properties>

<representation-property>uid</representation-property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@
<category>Lightbulb</category>
<channels>
<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="alert" id="alert"/>
</channels>

<properties>
<property name="thingTypeVersion">1</property>
<property name="thingTypeVersion">2</property>
</properties>

<representation-property>uid</representation-property>
Expand Down Expand Up @@ -132,13 +132,13 @@
<category>Lightbulb</category>
<channels>
<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="alert" id="alert"/>
</channels>

<properties>
<property name="thingTypeVersion">1</property>
<property name="thingTypeVersion">2</property>
</properties>

<representation-property>uid</representation-property>
Expand Down Expand Up @@ -169,14 +169,6 @@
<state pattern="%.1f %%"/>
</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">
<item-type>Number:Time</item-type>
<label>On Time</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<type>system:brightness</type>
</update-channel>
</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 uid="deconz:dimmablelight">
Expand All @@ -49,6 +54,11 @@
<type>system:color</type>
</update-channel>
</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 uid="deconz:lightgroup">
Expand All @@ -57,6 +67,11 @@
<type>system:color</type>
</update-channel>
</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 uid="deconz:onofflight">
Expand Down

0 comments on commit 9dac7f8

Please sign in to comment.