mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Devices - Added option to disable devices
This commit is contained in:
1 parent
25dcb16964
commit
bd6c93b292
14 files changed
+118
-52
No files matched your search
@@ -30,7 +30,8 @@ namespace Artemis.Core
|
||||
RedScale = 1;
|
||||
GreenScale = 1;
|
||||
BlueScale = 1;
|
||||
|
||||
IsEnabled = true;
|
||||
|
||||
deviceProvider.DeviceLayoutPaths.TryGetValue(rgbDevice, out string? layoutPath);
|
||||
LayoutPath = layoutPath;
|
||||
|
||||
@@ -213,6 +214,19 @@ namespace Artemis.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether this devices is enabled or not
|
||||
/// </summary>
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => DeviceEntity.IsEnabled;
|
||||
set
|
||||
{
|
||||
DeviceEntity.IsEnabled = value;
|
||||
OnPropertyChanged(nameof(IsEnabled));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to where the layout of the device was (attempted to be) loaded from
|
||||
/// </summary>
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Artemis.Core
|
||||
internal void UpdateLedMap()
|
||||
{
|
||||
LedMap = new ReadOnlyDictionary<Led, ArtemisLed>(
|
||||
_devices.SelectMany(d => d.Leds.Select(al => new KeyValuePair<Led, ArtemisLed>(al.RgbLed, al))).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)
|
||||
_devices.Where(d => d.IsEnabled).SelectMany(d => d.Leds.Select(al => new KeyValuePair<Led, ArtemisLed>(al.RgbLed, al))).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user