1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

ASUS - Expanded logging

ASUS - Initialize device provider inside the plugin instead of the surface
This commit is contained in:
SpoinkyNL 2020-06-30 20:53:33 +02:00
parent 2154822ce6
commit a39fbaf165

View File

@ -2,23 +2,31 @@
using Artemis.Core.Services.Interfaces;
using RGB.NET.Core;
using RGB.NET.Devices.Asus;
using Serilog;
namespace Artemis.Plugins.Devices.Asus
{
// ReSharper disable once UnusedMember.Global
public class AsusDeviceProvider : DeviceProvider
{
private readonly ILogger _logger;
private readonly IRgbService _rgbService;
public AsusDeviceProvider(IRgbService rgbService) : base(RGB.NET.Devices.Asus.AsusDeviceProvider.Instance)
public AsusDeviceProvider(IRgbService rgbService, ILogger logger) : base(RGB.NET.Devices.Asus.AsusDeviceProvider.Instance)
{
_rgbService = rgbService;
_logger = logger;
}
public override void EnablePlugin()
{
_logger.Debug("Expanding ResolvingAbsolutePath");
PathHelper.ResolvingAbsolutePath += (sender, args) => ResolveAbsolutePath(typeof(AsusRGBDevice<>), sender, args);
_logger.Debug("Initializing device provider");
RGB.NET.Devices.Asus.AsusDeviceProvider.Instance.Initialize(RGBDeviceType.All, false, true);
_logger.Debug("Adding device provider to surface");
_rgbService.AddDeviceProvider(RgbDeviceProvider);
_logger.Debug("Added device provider to surface");
}
}
}