mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
Small color tweaks (#18740)
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
This commit is contained in:
+7
-6
@@ -156,12 +156,12 @@ public class ColorControlConverter extends GenericConverter<ColorControlCluster>
|
||||
handler.sendClusterCommand(endpointNumber, OnOffCluster.CLUSTER_NAME, onOffCommand);
|
||||
} else if (command instanceof PercentType percentType) {
|
||||
if (channelUID.getIdWithoutGroup().equals(CHANNEL_ID_COLOR_TEMPERATURE)) {
|
||||
ClusterCommand tempCommand = ColorControlCluster.moveToColorTemperature(
|
||||
percentTypeToMireds(percentType), 0, initializingCluster.options, initializingCluster.options);
|
||||
handler.sendClusterCommand(endpointNumber, ColorControlCluster.CLUSTER_NAME, tempCommand);
|
||||
if (!lastOnOff) {
|
||||
handler.sendClusterCommand(endpointNumber, OnOffCluster.CLUSTER_NAME, OnOffCluster.on());
|
||||
}
|
||||
ClusterCommand tempCommand = ColorControlCluster.moveToColorTemperature(
|
||||
percentTypeToMireds(percentType), 0, initializingCluster.options, initializingCluster.options);
|
||||
handler.sendClusterCommand(endpointNumber, ColorControlCluster.CLUSTER_NAME, tempCommand);
|
||||
} else {
|
||||
if (percentType.equals(PercentType.ZERO)) {
|
||||
handler.sendClusterCommand(endpointNumber, OnOffCluster.CLUSTER_NAME, OnOffCluster.off());
|
||||
@@ -420,10 +420,11 @@ public class ColorControlConverter extends GenericConverter<ColorControlCluster>
|
||||
}
|
||||
|
||||
private void updateColorTemperature() {
|
||||
if (lastOnOff)
|
||||
if (lastOnOff) {
|
||||
updateState(CHANNEL_ID_COLOR_TEMPERATURE, miredsToPercentType(lastColorTemperatureMireds));
|
||||
updateState(CHANNEL_ID_COLOR_TEMPERATURE_ABS,
|
||||
QuantityType.valueOf(Double.valueOf(lastColorTemperatureMireds), Units.MIRED));
|
||||
updateState(CHANNEL_ID_COLOR_TEMPERATURE_ABS,
|
||||
QuantityType.valueOf(Double.valueOf(lastColorTemperatureMireds), Units.MIRED));
|
||||
}
|
||||
colorTemperatureState = ColorUpdateState.READY;
|
||||
colorModeToTemperature();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user