'Test for transition time being sent when included.'

def test_transition(self):

    assert setup_component(self.hass, light.DOMAIN, {light.DOMAIN: {'platform': 'mqtt_json', 'name': 'test', 'state_topic': 'test_light_rgb', 'command_topic': 'test_light_rgb/set', 'qos': 0}})
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_OFF, state.state)
    self.assertEqual(40, state.attributes.get(ATTR_SUPPORTED_FEATURES))
    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])
    message_json = json.loads(self.mock_publish.mock_calls[(-2)][1][1])
    self.assertEqual(10, message_json['transition'])
    self.assertEqual('ON', message_json['state'])
    light.turn_off(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])
    message_json = json.loads(self.mock_publish.mock_calls[(-2)][1][1])
    self.assertEqual(10, message_json['transition'])
    self.assertEqual('OFF', message_json['state'])
