Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deconz] Improve color temperature channel #17777

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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