Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,14 @@ def setColorTemperature(temp) {
def warmValue = temp < 5000 ? 255 : 0
def coldValue = temp >= 5000 ? 255 : 0
def parameterNumber = temp < 5000 ? WARM_WHITE_CONFIG : COLD_WHITE_CONFIG
def cmds = [zwave.configurationV1.configurationSet([parameterNumber: parameterNumber, size: 2, scaledConfigurationValue: temp]),
zwave.switchColorV3.switchColorSet(warmWhite: warmValue, coldWhite: coldValue)]
commands(cmds) + "delay 7000" + commands(queryAllColors(), 500)
def results = []
results << zwave.configurationV1.configurationSet([parameterNumber: parameterNumber, size: 2, scaledConfigurationValue: temp])
results << zwave.switchColorV3.switchColorSet(warmWhite: warmValue, coldWhite: coldValue)
if (device.currentValue("switch") != "on") {
results << zwave.basicV1.basicSet(value: 0xFF)
Copy link
Contributor

@greens greens Oct 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My instinct would be that the on should come before the color set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the device behave in either scenario? If I do the color set followed by on does it come on with the color that was set just prior? I imagine if I turn on and then do color set the bulb comes on at the last color and then changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct @dkirker. That is why I put "on" command after setting the color temperature, because then the bulb immediately turns on the light at the selected color temperature, without waiting for a change from the previous value.
The same logic guided me here: #11479. If I put "on" command before setting the color, first the bulb would turn on with the last color and then changes to which I choose. I can imagine that this situation would be reported as a bug. But when I put "on" command after, the bulb switch to the desired color value right away.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greens, you mentioned in Jira ticket that there were problems with zigbee devices in similar cases so if you think that putting "on" command first would cause less problems I can change it. We can simply inform testers that this is how it should work to avoid more serious issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I guess if we don't have any device where it's misbehaving yet this is fine. We can always update it later if we run into one of those devices where it doesn't work.

results << zwave.switchMultilevelV3.switchMultilevelGet()
}
commands(results) + "delay 7000" + commands(queryAllColors(), 500)
}

private queryAllColors() {
Expand Down