'Test for transition time being sent when included.'

def test_transition(self):

    with assert_setup_component(1, light.DOMAIN):
        assert setup_component(self.hass, light.DOMAIN, {light.DOMAIN: {'platform': 'mqtt_template', 'name': 'test', 'command_topic': 'test_light_rgb/set', 'command_on_template': 'on,{{    transition    }}', 'command_off_template': 'off,{{    transition|d    }}'}})
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_OFF, state.state)
    light.turn_on(self.hass, 'light.test', transition=10)
    self.hass.block_till_done()
    self.assertEqual('test_light_rgb/set', self.mock_publish.mock_calls[(-2)][1][0])
    self.assertEqual(0, self.mock_publish.mock_calls[(-2)][1][2])
    self.assertEqual(False, self.mock_publish.mock_calls[(-2)][1][3])
    payload = self.mock_publish.mock_calls[(-2)][1][1]
    self.assertEqual('on,10', payload)
    light.turn_off(self.hass, 'light.test', transition=4)
    self.hass.block_till_done()
    self.assertEqual('test_light_rgb/set', self.mock_publish.mock_calls[(-2)][1][0])
    self.assertEqual(0, self.mock_publish.mock_calls[(-2)][1][2])
    self.assertEqual(False, self.mock_publish.mock_calls[(-2)][1][3])
    payload = self.mock_publish.mock_calls[(-2)][1][1]
    self.assertEqual('off,4', payload)
