private static async Task <bool> RunAddAndReturnExitCode(AddOptions opts)
        {
            if (!configurationHelper.ReadConfig())
            {
                return(false);
            }

            bool isSuccess = false;

            opts = iotDeviceHelper.CleanOptions(opts as object, true) as AddOptions;
            opts = iotDeviceHelper.CompleteMissingAddOptions(opts, configurationHelper);

            if (iotDeviceHelper.VerifyDevice(opts, null, null, null, configurationHelper, true))
            {
                Twin twin = iotDeviceHelper.CreateDeviceTwin(opts);
                isSuccess = await iotDeviceHelper.WriteDeviceTwin(twin, opts.DevEui, configurationHelper, true);
            }
            else
            {
                StatusConsole.WriteLogLine(MessageType.Error, $"Can not add {opts.Type.ToUpper()} device.");
            }

            if (isSuccess)
            {
                var twin = await iotDeviceHelper.QueryDeviceTwin(opts.DevEui, configurationHelper);

                StatusConsole.WriteTwin(opts.DevEui, twin);
            }

            return(isSuccess);
        }
        private static object RunAddAndReturnExitCode(AddOptions opts)
        {
            if (!configurationHelper.ReadConfig())
            {
                return(false);
            }

            bool isSuccess = false;

            opts = iotDeviceHelper.CleanOptions(opts as object, true) as AddOptions;
            opts = iotDeviceHelper.CompleteMissingAddOptions(opts, configurationHelper);

            if (iotDeviceHelper.VerifyDevice(opts, null, null, null, configurationHelper))
            {
                Twin twin = iotDeviceHelper.CreateDeviceTwin(opts);
                isSuccess = iotDeviceHelper.WriteDeviceTwin(twin, opts.DevEui, configurationHelper, true).Result;
            }
            else
            {
                StatusConsole.WriteLine(MessageType.Error, $"Can not add {opts.Type.ToUpper()} device.");
            }

            if (isSuccess)
            {
                var twin = iotDeviceHelper.QueryDeviceTwin(opts.DevEui, configurationHelper).Result;
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine($"DevEUI: {opts.DevEui}");
                Console.WriteLine(TwinToString(twin));
                Console.ResetColor();
            }

            return(isSuccess);
        }