Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Aug 19, 2022
1 parent ba006f0 commit e40d4d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CorsairDevice : DefaultDevice

protected override string DeviceInfo => string.Join(", ", deviceInfos.Select(d => d.Model));

private readonly List<CorsairDeviceInfo> deviceInfos = new List<CorsairDeviceInfo>();
private readonly List<CorsairDeviceInfo> deviceInfos = new();

public override bool Initialize()
{
Expand Down
2 changes: 1 addition & 1 deletion Project-Aurora/Project-Aurora/Devices/DeviceKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ public enum DeviceKeys
/// Peripheral DPI
/// </summary>
[Description("PERIPHERAL_DPI")]
PERIPHERAL_DPI = 237,
PERIPHERAL_DPI = 237,

/// <summary>
/// Additional Light 33
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Aurora.Profiles;
using YeeLightAPI.YeeLightDeviceLocator;
using YeeLightAPI.YeeLightConstants;
using YeeLightAPI.YeeLightExceptions;
Expand Down Expand Up @@ -132,7 +133,7 @@ private bool TryUpdate(IReadOnlyDictionary<DeviceKeys, Color> keyColors)
return ProceedSameColor(targetColor);
_previousColor = targetColor;

if (IsWhiteTone(targetColor))
if (IsWhiteTone(targetColor)) // && Global.LightingStateManager.GetCurrentProfile() == Global.LightingStateManager.DesktopProfile
{
return ProceedDifferentWhiteColor(targetColor);
}
Expand Down
16 changes: 8 additions & 8 deletions Project-Aurora/Project-Aurora/Profiles/LightingStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ void OnDeserialized(StreamingContext context)

public class LightingStateManager : ObjectSettings<ProfilesManagerSettings>, IInit
{
public Dictionary<string, ILightEvent> Events { get; private set; } = new Dictionary<string, ILightEvent> { { "desktop", new Desktop.Desktop() } };
public Dictionary<string, ILightEvent> Events { get; } = new() { { "desktop", new Desktop.Desktop() } };

public Desktop.Desktop DesktopProfile { get { return (Desktop.Desktop)Events["desktop"]; } }
public Desktop.Desktop DesktopProfile => (Desktop.Desktop)Events["desktop"];

private List<ILightEvent> StartedEvents = new List<ILightEvent>();
private List<ILightEvent> UpdatedEvents = new List<ILightEvent>();
private List<ILightEvent> StartedEvents = new();
private List<ILightEvent> UpdatedEvents = new();

private Dictionary<string, string> EventProcesses { get; set; } = new Dictionary<string, string>();
private Dictionary<string, string> EventProcesses { get; } = new();

private Dictionary<string, string> EventTitles { get; set; } = new Dictionary<string, string>();
private Dictionary<string, string> EventTitles { get; } = new();

private Dictionary<string, string> EventAppIDs { get; set; } = new Dictionary<string, string>();
private Dictionary<string, string> EventAppIDs { get; } = new();

public Dictionary<Type, LayerHandlerMeta> LayerHandlers { get; private set; } = new Dictionary<Type, LayerHandlerMeta>();
public Dictionary<Type, LayerHandlerMeta> LayerHandlers { get; } = new();

public string AdditionalProfilesPath = Path.Combine(Global.AppDataDirectory, "AdditionalProfiles");

Expand Down

0 comments on commit e40d4d9

Please sign in to comment.