1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Added defaults to openrgb device definition

This commit is contained in:
Darth Affe 2023-01-06 14:22:10 +01:00
parent 553f99af26
commit 01e671ddeb
2 changed files with 12 additions and 4 deletions

View File

@ -56,6 +56,14 @@ public class OpenRGBDeviceProvider : AbstractRGBDeviceProvider
#endregion
#region Methods
/// <summary>
/// Adds the specified <see cref="OpenRGBServerDefinition" /> to this device-provider.
/// </summary>
/// <param name="deviceDefinition">The <see cref="OpenRGBServerDefinition"/> to add.</param>
// ReSharper disable once UnusedMember.Global
public void AddDeviceDefinition(OpenRGBServerDefinition deviceDefinition) => DeviceDefinitions.Add(deviceDefinition);
/// <inheritdoc />
protected override void InitializeSDK()
{
@ -63,7 +71,7 @@ public class OpenRGBDeviceProvider : AbstractRGBDeviceProvider
{
try
{
OpenRGBClient? openRgb = new(ip: deviceDefinition.Ip, port: deviceDefinition.Port, name: deviceDefinition.ClientName, autoconnect: true);
OpenRGBClient openRgb = new(ip: deviceDefinition.Ip, port: deviceDefinition.Port, name: deviceDefinition.ClientName, autoconnect: true);
_clients.Add(openRgb);
deviceDefinition.Connected = true;
}

View File

@ -8,17 +8,17 @@ public class OpenRGBServerDefinition
/// <summary>
/// The name of the client that will appear in the OpenRGB interface.
/// </summary>
public string? ClientName { get; set; }
public string? ClientName { get; set; } = "RGB.NET";
/// <summary>
/// The ip address of the server.
/// </summary>
public string? Ip { get; set; }
public string? Ip { get; set; } = "127.0.0.1";
/// <summary>
/// The port of the server.
/// </summary>
public int Port { get; set; }
public int Port { get; set; } = 6742;
/// <summary>
/// Whether the provider is connected to this server definition or not.