Skip to content

Commit d2a6287

Browse files
committed
View bridge config
1 parent 58b36f5 commit d2a6287

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

HueEntertainmentPro/Client/HueEntertainmentPro.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="HueApi" Version="3.1.0" />
13+
<PackageReference Include="HueApi" Version="3.1.2" />
1414
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1" />
1515
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.1" PrivateAssets="all" />
1616
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.1" />

HueEntertainmentPro/Client/Pages/BridgeDetail.razor

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
@page "/bridge/{Id:guid}"
2+
@using HueApi.Models.Clip
3+
@using HueEntertainmentPro.Client.Services
4+
@using HueEntertainmentPro.Client.Shared.ResourceExplorerComponents
25
@using HueEntertainmentPro.Shared.Interfaces
36
@using HueEntertainmentPro.Shared.Models
47
@using HueEntertainmentPro.Shared.Models.Requests
58
@using HueLightDJ.Services.Interfaces
69
@using HueLightDJ.Services.Interfaces.Models
10+
@using System.Text.Json
711
@inject IBridgeDataService BridgeService
812
@inject IHueSetupService HueSetupService
913
@inject NavigationManager Navigation
1014
@inject IDialogService DialogService
1115
@inject IToastService ToastService
16+
@inject ResourceExplorerService ResourceExplorerService
1217

1318
<h3>Bridge Details</h3>
1419

@@ -31,6 +36,7 @@
3136
</FluentStack>
3237
</FluentStack>
3338

39+
3440
<h4 style="margin-top: 20px;">Entertainment Groups</h4>
3541
@if (entertainmentGroups == null)
3642
{
@@ -47,6 +53,22 @@
4753
{
4854
<FluentLabel>No entertainment groups found for this bridge.</FluentLabel>
4955
}
56+
57+
<h4 style="margin-top: 20px;">Bridge Config</h4>
58+
<p>
59+
Explore more bridge details on the <a href="/resource-explorer/@Id">Resource Explorer</a>.<br />
60+
View <a href="http://@bridge.Ip/description.xml" target="_blank">description.xml</a>.<br />
61+
</p>
62+
@if (bridgeConfig == null)
63+
{
64+
<FluentProgressRing>Loading bridge config...</FluentProgressRing>
65+
}
66+
else
67+
{
68+
<JsonViewer Element="@JsonSerializer.SerializeToElement(bridgeConfig)" Bridge="@bridge" />
69+
}
70+
71+
5072
}
5173
else
5274
{
@@ -58,13 +80,17 @@ else
5880
public Guid Id { get; set; }
5981

6082
private Bridge? bridge;
83+
private BridgeConfig? bridgeConfig;
6184
private IQueryable<SimpleEntertainmentGroup>? entertainmentGroups;
6285
private string? errorMessage;
6386

6487
protected override async Task OnInitializedAsync()
6588
{
6689
try
6790
{
91+
bridgeConfig = null;
92+
entertainmentGroups = null;
93+
6894
// Load bridge details
6995
bridge = await BridgeService.GetBridge(new GuidRequest() { Id = Id });
7096
if (bridge == null)
@@ -73,6 +99,9 @@ else
7399
return;
74100
}
75101

102+
var localHueClient = ResourceExplorerService.GetHueClient(bridge);
103+
bridgeConfig = await localHueClient.GetConfigAsync();
104+
76105
// Load entertainment groups
77106
var result = await HueSetupService.GetEntertainmentGroupsAsync(new HueLightDJ.Services.Interfaces.Models.Requests.HueSetupRequest()
78107
{

HueLightDJ.Effects/HueLightDJ.Effects.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="HueApi" Version="3.1.0" />
10+
<PackageReference Include="HueApi" Version="3.1.2" />
1111
<PackageReference Include="HueApi.ColorConverters" Version="3.1.0" />
1212
<PackageReference Include="HueApi.Entertainment" Version="3.1.0" />
1313
</ItemGroup>

0 commit comments

Comments
 (0)