Trim CW from RGB when not supported in ozw (#39191)

* Trim the CW value if CW isn't supported

* Trim CW from white level as well
This commit is contained in:
Chris 2020-08-23 16:20:37 -07:00 committed by GitHub
parent 2e8506de80
commit 7462d140af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View file

@ -377,11 +377,11 @@ async def test_pure_rgb_dimmer_light(
msg = sent_messages[-2]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": "#ff4cff0000", "ValueIDKey": 122470423}
assert msg["payload"] == {"Value": "#ff4cff00", "ValueIDKey": 122470423}
# Feedback on state
light_pure_rgb_msg.decode()
light_pure_rgb_msg.payload["Value"] = "#ff4cff0000"
light_pure_rgb_msg.payload["Value"] = "#ff4cff00"
light_pure_rgb_msg.encode()
receive_message(light_pure_rgb_msg)
await hass.async_block_till_done()
@ -500,14 +500,14 @@ async def test_no_cw_light(
assert len(sent_messages) == 2
msg = sent_messages[-2]
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
assert msg["payload"] == {"Value": "#000000be00", "ValueIDKey": 659341335}
assert msg["payload"] == {"Value": "#000000be", "ValueIDKey": 659341335}
# Feedback on state
light_msg.decode()
light_msg.payload["Value"] = byte_to_zwave_brightness(255)
light_msg.encode()
light_rgb_msg.decode()
light_rgb_msg.payload["Value"] = "#000000be00"
light_rgb_msg.payload["Value"] = "#000000be"
light_rgb_msg.encode()
receive_message(light_msg)
receive_message(light_rgb_msg)