diff --git a/src/MoonrakerSharpWebApi/MoonrakerClient.Database.cs b/src/MoonrakerSharpWebApi/MoonrakerClient.Database.cs index 15a1628..f0ae3e7 100644 --- a/src/MoonrakerSharpWebApi/MoonrakerClient.Database.cs +++ b/src/MoonrakerSharpWebApi/MoonrakerClient.Database.cs @@ -35,7 +35,6 @@ public async Task> ListDatabaseNamespacesAsync() command: "database/list", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegments, cts: default ) .ConfigureAwait(false); @@ -105,7 +104,6 @@ public async Task> GetDatabaseItemAsync(string namesp // If namespace is missing, just return an empty resultObject now else return resultObject; } - Dictionary urlSegments = new() { { "namespace", namespaceName } diff --git a/src/MoonrakerSharpWebApi/MoonrakerClient.Printers.cs b/src/MoonrakerSharpWebApi/MoonrakerClient.Printers.cs index 8c6b454..894c132 100644 --- a/src/MoonrakerSharpWebApi/MoonrakerClient.Printers.cs +++ b/src/MoonrakerSharpWebApi/MoonrakerClient.Printers.cs @@ -86,8 +86,6 @@ public async Task RefreshPrinterInfoAsync() KlipperPrinterStateMessageResult? resultObject = null; try { - //object cmd = new { name = ScriptName }; - string targetUri = $"{MoonrakerCommands.Printer}"; result = await SendRestApiRequestAsync( requestTargetUri: targetUri, @@ -95,7 +93,6 @@ public async Task RefreshPrinterInfoAsync() command: "info", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegements, cts: default ) .ConfigureAwait(false); @@ -128,8 +125,6 @@ public async Task EmergencyStopPrinterAsync() { try { - //object cmd = new { name = ScriptName }; - string targetUri = $"{MoonrakerCommands.Printer}"; IRestApiRequestRespone? result = await SendRestApiRequestAsync( requestTargetUri: targetUri, @@ -137,7 +132,6 @@ public async Task EmergencyStopPrinterAsync() command: "emergency_stop", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegements, cts: default ) .ConfigureAwait(false); @@ -159,7 +153,6 @@ public async Task RestartPrinterAsync() { try { - //object cmd = new { name = ScriptName }; string targetUri = $"{MoonrakerCommands.Printer}"; IRestApiRequestRespone? result = await SendRestApiRequestAsync( requestTargetUri: targetUri, @@ -167,7 +160,6 @@ public async Task RestartPrinterAsync() command: "restart", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegements, cts: default ) .ConfigureAwait(false); @@ -189,7 +181,6 @@ public async Task RestartFirmwareAsync() { try { - //object cmd = new { name = ScriptName }; string targetUri = $"{MoonrakerCommands.Printer}"; IRestApiRequestRespone? result = await SendRestApiRequestAsync( requestTargetUri: targetUri, @@ -197,7 +188,6 @@ public async Task RestartFirmwareAsync() command: "firmware_restart", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegements, cts: default ) .ConfigureAwait(false); @@ -319,7 +309,6 @@ public async Task> GetPrinterObjectListAsync(string startsWith = "" List resultObject = []; try { - //object cmd = new { name = ScriptName }; string targetUri = $"{MoonrakerCommands.Printer}"; result = await SendRestApiRequestAsync( requestTargetUri: targetUri, @@ -327,7 +316,6 @@ public async Task> GetPrinterObjectListAsync(string startsWith = "" command: "objects/list", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegements, cts: default ) .ConfigureAwait(false); @@ -1268,7 +1256,6 @@ public async Task SubscribeAllPrinterObjectStatusAsync(long? connectionI command: "query_endstops/status", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegements, cts: default ) .ConfigureAwait(false); diff --git a/src/MoonrakerSharpWebApi/MoonrakerClient.WebCam.cs b/src/MoonrakerSharpWebApi/MoonrakerClient.WebCam.cs index d7c2fff..808b49b 100644 --- a/src/MoonrakerSharpWebApi/MoonrakerClient.WebCam.cs +++ b/src/MoonrakerSharpWebApi/MoonrakerClient.WebCam.cs @@ -32,7 +32,6 @@ public partial class MoonrakerClient command: "webcams/list", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegments, cts: default ) .ConfigureAwait(false); diff --git a/src/MoonrakerSharpWebApi/MoonrakerClient.cs b/src/MoonrakerSharpWebApi/MoonrakerClient.cs index f7b61e7..79c328b 100644 --- a/src/MoonrakerSharpWebApi/MoonrakerClient.cs +++ b/src/MoonrakerSharpWebApi/MoonrakerClient.cs @@ -1345,7 +1345,7 @@ public async Task> GetGcodeHelpAsync() string targetUri = $"{MoonrakerCommands.Printer}"; result = await SendRestApiRequestAsync( requestTargetUri: targetUri, - method: Method.Post, + method: Method.Get, command: "gcode/help", jsonObject: null, authHeaders: AuthHeaders, @@ -1563,7 +1563,7 @@ public async Task MoveAxesAsync( string targetUri = $"{MoonrakerCommands.Machine}"; result = await SendRestApiRequestAsync( requestTargetUri: targetUri, - method: Method.Post, + method: Method.Get, command: "system_info", jsonObject: null, authHeaders: AuthHeaders, @@ -2867,7 +2867,7 @@ await SendRestApiRequestAsync(MoonrakerCommandBase.machine, Method.Get, $"device public async Task> SetDeviceStateAsync(string device, KlipperDeviceActions action) { IRestApiRequestRespone? result = null; - Dictionary resultObject = new(); + Dictionary resultObject = []; try { Dictionary urlSegments = new() @@ -2969,7 +2969,7 @@ await SendRestApiRequestAsync(MoonrakerCommandBase.machine, Method.Get, $"device public async Task> SetBatchDeviceOnAsync(string[] devices) { IRestApiRequestRespone? result = null; - Dictionary resultObject = new(); + Dictionary resultObject = []; try { StringBuilder deviceList = new(); @@ -3361,7 +3361,7 @@ await SendRestApiRequestAsync(MoonrakerCommandBase.api, Method.Post, "printer/co } } - public Task SendOctoPrintApiGcodeCommandAsync(string command) => SendOctoPrintApiGcodeCommandAsync(new string[] { command }); + public Task SendOctoPrintApiGcodeCommandAsync(string command) => SendOctoPrintApiGcodeCommandAsync([command]); public async Task> GetOctoPrintApiPrinterProfilesAsync() { @@ -3486,7 +3486,6 @@ await SendRestApiRequestAsync(MoonrakerCommandBase.server, Method.Get, $"history command: $"history/totals", jsonObject: null, authHeaders: AuthHeaders, - //urlSegments: urlSegments, cts: default ) .ConfigureAwait(false);