Refactor DDC monitor discovery; clarify interface docs

Refactored DiscoverMonitorsAsync in DdcCiController to remove Task.Run and simplify async flow and error handling. Updated XML doc for Name property in IMonitorController to clarify its purpose.
This commit is contained in:
Yu Leng
2025-12-10 08:43:44 +08:00
parent c093332f84
commit 095ae2bebd
2 changed files with 28 additions and 33 deletions

View File

@@ -369,9 +369,6 @@ namespace PowerDisplay.Common.Drivers.DDC
/// Phase 3: Create Monitor objects for valid DDC/CI monitors
/// </summary>
public async Task<IEnumerable<Monitor>> DiscoverMonitorsAsync(CancellationToken cancellationToken = default)
{
return await Task.Run(
async () =>
{
try
{
@@ -405,8 +402,6 @@ namespace PowerDisplay.Common.Drivers.DDC
Logger.LogError($"DDC: DiscoverMonitorsAsync exception: {ex.Message}\nStack: {ex.StackTrace}");
return Enumerable.Empty<Monitor>();
}
},
cancellationToken);
}
/// <summary>

View File

@@ -17,7 +17,7 @@ namespace PowerDisplay.Common.Interfaces
public interface IMonitorController
{
/// <summary>
/// Controller name
/// Gets controller name
/// </summary>
string Name { get; }