mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-03-12 12:01:40 -04:00
Update to .NET Core 3.1 and apply Roslyn suggestions
This commit is contained in:
@@ -49,8 +49,8 @@ namespace ChrisKaczor.HomeMonitor.Power.Service
|
||||
|
||||
var sample = JsonSerializer.Deserialize<PowerSample>(response.Content);
|
||||
|
||||
var generation = sample.Channels.FirstOrDefault(c => c.Type == "GENERATION");
|
||||
var consumption = sample.Channels.FirstOrDefault(c => c.Type == "CONSUMPTION");
|
||||
var generation = Array.Find(sample.Channels, c => c.Type == "GENERATION");
|
||||
var consumption = Array.Find(sample.Channels, c => c.Type == "CONSUMPTION");
|
||||
|
||||
if (generation == null || consumption == null)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user