Skip to content

Commit baea25e

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents e50d779 + d1349aa commit baea25e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/HomeBlaze.Gardena/GardenaLocationSetup.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ else if (_locations != null)
5959
private string? _clientId = null;
6060

6161
private Location[]? _locations = null;
62-
private object? _selectedLocation;
62+
private Location? _selectedLocation;
6363

6464
private bool _loading;
6565

@@ -77,11 +77,11 @@ else if (_locations != null)
7777

7878
private void Update(GardenaLocation thing)
7979
{
80-
if (_selectedLocation is Location selectedLocation)
80+
if (_selectedLocation is not null)
8181
{
8282
thing.Username = _username;
8383
thing.Password = _password;
84-
thing.LocationId = selectedLocation.Id;
84+
thing.LocationId = _selectedLocation.Id;
8585
thing.Reset();
8686
}
8787
}
@@ -112,7 +112,7 @@ else if (_locations != null)
112112
{
113113
try
114114
{
115-
if (_selectedLocation is Location selectedLocation)
115+
if (_selectedLocation is not null)
116116
{
117117
var thing = (GardenaLocation)ActivatorUtilities.CreateInstance(ServiceProvider, typeof(GardenaLocation));
118118
Update(thing);

src/HomeBlaze.Nuki/NukiBridgeSetup.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ else
6161
}
6262

6363
@code {
64-
private object? _selectedBridge;
64+
private BridgeModel? _selectedBridge;
6565

6666
private BridgeModel[]? Bridges { get; set; }
6767

@@ -78,7 +78,7 @@ else
7878
var response = await httpClient.GetAsync("https://api.nuki.io/discover/bridges");
7979
var result = JsonSerializer.Deserialize<DiscoverResult>(await response.Content.ReadAsStringAsync());
8080

81-
Bridges = result?.Bridges ?? new BridgeModel[0];
81+
Bridges = result?.Bridges ?? [];
8282
}
8383
catch (Exception e)
8484
{
@@ -117,7 +117,7 @@ else
117117
{
118118
try
119119
{
120-
if (_selectedBridge is BridgeModel selectedBridge)
120+
if (_selectedBridge is { } selectedBridge)
121121
{
122122
IsWaitingForButton = true;
123123
await InvokeAsync(StateHasChanged);

0 commit comments

Comments
 (0)