Skip to content

Commit 82e463b

Browse files
committed
Update SDK
1 parent eb8e61e commit 82e463b

File tree

5 files changed

+25
-33
lines changed

5 files changed

+25
-33
lines changed

Desktop/Backend/OpenShockApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void Logout()
8484
}
8585

8686
public
87-
Task<OneOf<Success<LcgResponse>, NotFound, DeviceOffline, DeviceNotConnectedToGateway, UnauthenticatedError>>
87+
Task<OneOf<Success<LcgResponse>, NotFound, DeviceOffline, UnauthenticatedError>>
8888
GetDeviceGateway(Guid deviceId, CancellationToken cancellationToken = default)
8989
{
9090
if (Client == null)

Desktop/Cli/MauiCliOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace OpenShock.Desktop.Cli;
44

55
public sealed class MauiCliOptions : CliOptions
66
{
7-
[Option('c', "console", Required = false, Default = false, HelpText = "Create console window for stdout/stderr.")]
7+
[Option('c', "console", Required = false, Default = false, HelpText = "Create/attach console window for stdout/stderr. This is very buggy since we only attach to it...")]
88
public required bool Console { get; init; }
99

1010
[Option("uri", Required = false, HelpText = "Custom URI for callbacks")]

Desktop/Desktop.csproj

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
</PropertyGroup>
3838

3939
<ItemGroup Condition="'$(Configuration)' == 'Debug-Windows' Or '$(Configuration)' == 'Release-Windows'">
40-
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.60" />
41-
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.60" />
42-
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.60" />
40+
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.70" />
41+
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.70" />
42+
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.70" />
43+
<PackageReference Update="Microsoft.AspNetCore.Components.Web" Version="9.0.5" />
4344
</ItemGroup>
4445

4546
<PropertyGroup Condition="'$(Configuration)' == 'Debug-Photino' Or '$(Configuration)' == 'Release-Photino'">
@@ -60,23 +61,23 @@
6061
</PropertyGroup>
6162

6263
<ItemGroup>
63-
<PackageReference Include="AspNetCore.SassCompiler" Version="1.87.0" />
64+
<PackageReference Include="AspNetCore.SassCompiler" Version="1.89.0" />
6465
<PackageReference Include="CommandLineParser" Version="2.9.1"/>
65-
<PackageReference Include="dnlib" Version="4.4.0" />
66-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.4" />
67-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.4" />
68-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.4" />
69-
<PackageReference Include="MudBlazor" Version="8.6.0" />
66+
<PackageReference Include="dnlib" Version="4.5.0" />
67+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.5" />
68+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
69+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
70+
<PackageReference Include="MudBlazor" Version="8.7.0" />
7071
<PackageReference Include="Semver" Version="3.0.0" />
71-
<PackageReference Include="Serilog" Version="4.2.0" />
72-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.4" />
72+
<PackageReference Include="Serilog" Version="4.3.0" />
73+
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.5" />
7374
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
7475
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.1" />
7576
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
7677
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
77-
<PackageReference Include="OpenShock.SDK.CSharp" Version="0.0.34" />
78-
<PackageReference Include="OpenShock.SDK.CSharp.Hub" Version="0.0.33" />
79-
<PackageReference Include="OpenShock.SDK.CSharp.Live" Version="0.0.33" />
78+
<PackageReference Include="OpenShock.SDK.CSharp" Version="0.0.35" />
79+
<PackageReference Include="OpenShock.SDK.CSharp.Hub" Version="0.0.35" />
80+
<PackageReference Include="OpenShock.SDK.CSharp.Live" Version="0.0.35" />
8081
<PackageReference Include="System.Reactive" Version="6.0.1" />
8182
</ItemGroup>
8283

Desktop/Services/LiveControlManager.cs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,29 @@ namespace OpenShock.Desktop.Services;
1212
public sealed class LiveControlManager
1313
{
1414
private readonly ILogger<LiveControlManager> _logger;
15-
private readonly OpenShockApi _api;
1615
private readonly ConfigManager _configManager;
1716
private readonly ILogger<OpenShockLiveControlClient> _liveControlLogger;
18-
private readonly OpenShockHubClient _hubClient;
1917
private readonly OpenShockApi _apiClient;
2018
private readonly SemaphoreSlim _refreshLock = new(1, maxCount: 1);
2119

2220
public LiveControlManager(
2321
ILogger<LiveControlManager> logger,
24-
OpenShockApi api,
2522
ConfigManager configManager,
2623
ILogger<OpenShockLiveControlClient> liveControlLogger,
2724
OpenShockHubClient hubClient,
2825
OpenShockApi apiClient)
2926
{
3027
_logger = logger;
31-
_api = api;
3228
_configManager = configManager;
3329
_liveControlLogger = liveControlLogger;
34-
_hubClient = hubClient;
3530
_apiClient = apiClient;
3631

37-
_hubClient.OnHubStatus.SubscribeAsync(async _ =>
32+
hubClient.OnHubStatus.SubscribeAsync(async _ =>
3833
{
3934
_logger.LogDebug("Device update received, updating shockers and refreshing connections");
4035
await RefreshConnections();
4136
}).AsTask().Wait();
42-
_hubClient.OnHubUpdate.SubscribeAsync(async _ =>
37+
hubClient.OnHubUpdate.SubscribeAsync(async _ =>
4338
{
4439
_logger.LogDebug("Device status received, refreshing connections");
4540
await RefreshConnections();
@@ -64,19 +59,21 @@ public async Task RefreshConnections()
6459
}
6560
}
6661

62+
// TODO: Should probably make this be dependent on the online status we get via signalr hub.
63+
// Right now it will try to get the device gateway everytime there is a status update or hub details update.
6764
private async Task RefreshInternal()
6865
{
6966
_logger.LogDebug("Refreshing live control connections");
7067

7168
// Remove devices that dont exist anymore
7269
foreach (var liveControlClient in LiveControlClients)
7370
{
74-
if (_api.Hubs.Value.Any(x => x.Id == liveControlClient.Key)) continue;
71+
if (_apiClient.Hubs.Value.Any(x => x.Id == liveControlClient.Key)) continue;
7572
if (!LiveControlClients.Remove(liveControlClient.Key, out var removedClient))
7673
await removedClient!.DisposeAsync();
7774
}
7875

79-
foreach (var device in _api.Hubs.Value)
76+
foreach (var device in _apiClient.Hubs.Value)
8077
{
8178
if (LiveControlClients.ContainsKey(device.Id)) continue;
8279

@@ -107,14 +104,7 @@ private async Task RefreshInternal()
107104
_logger.LogInformation("Failed to get device gateway for device [{DeviceId}], device offline",
108105
device.Id);
109106
},
110-
gateway =>
111-
{
112-
_logger.LogError(
113-
"Failed to get device gateway for device [{DeviceId}], " +
114-
"the device is online but its not connected to a gateway, this means the device is probably" +
115-
" outdated and does not support live control. Please upgrade your device",
116-
device.Id);
117-
}, unauthenticated =>
107+
unauthenticated =>
118108
{
119109
_logger.LogError(
120110
"Failed to get device gateway for device [{DeviceId}], we are not authenticated",

ModuleBase/ModuleBase.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="OpenShock.MinimalEvents" Version="0.0.1" />
24+
<PackageReference Update="Microsoft.AspNetCore.Components.Web" Version="9.0.5" />
2425
</ItemGroup>
2526

2627
</Project>

0 commit comments

Comments
 (0)