Fix RGB template ordering in MQTT Light (#11362)

* Use different colour channel intensities in tests

Uses a different value for each colour channel in MQTT light tests to
properly differentiate between colour channels.

* Correct ordering of RGB channels in MQTT light
This commit is contained in:
Dan Nixon authored and Martin Hjelmare committed 2017-12-29 15:28:20 +01:00
1 parent cfd78f7b02
commit f07a4684e0
3 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -546,17 +546,17 @@ class TestLightMQTT(unittest.TestCase):
state = self.hass.states.get('light.test')
self.assertEqual(STATE_OFF, state.state)
light.turn_on(self.hass, 'light.test', rgb_color=[255, 255, 255])
light.turn_on(self.hass, 'light.test', rgb_color=[255, 128, 64])
self.hass.block_till_done()
self.mock_publish().async_publish.assert_has_calls([
mock.call('test_light_rgb/set', 'on', 0, False),
mock.call('test_light_rgb/rgb/set', '#ffffff', 0, False),
mock.call('test_light_rgb/rgb/set', '#ff8040', 0, False),
], any_order=True)
state = self.hass.states.get('light.test')
self.assertEqual(STATE_ON, state.state)
self.assertEqual((255, 255, 255), state.attributes['rgb_color'])
self.assertEqual((255, 128, 64), state.attributes['rgb_color'])
def test_show_brightness_if_only_command_topic(self):
"""Test the brightness if only a command topic is present."""