'Try to send proper data.'

@patch('pilight.pilight.Client', PilightDaemonSim)
@patch('tests.components.test_pilight._LOGGER.error')
def test_send_code(self, mock_pilight_error):

    with assert_setup_component(4):
        self.assertTrue(setup_component(self.hass, pilight.DOMAIN, {pilight.DOMAIN: {}}))
        service_data = {'protocol': 'test', 'value': 42}
        self.hass.services.call(pilight.DOMAIN, pilight.SERVICE_NAME, service_data=service_data, blocking=True)
        self.hass.block_till_done()
        error_log_call = mock_pilight_error.call_args_list[(-1)]
        service_data['protocol'] = [service_data['protocol']]
        self.assertTrue((str(service_data) in str(error_log_call)))
