feat: Adds ISelectableItems/Item and IHasSurroundSoundModes, modfies IHasInputs, Updates MockDisplay to implement IHasInputs

This commit is contained in:
Neil Dorin
2024-03-14 11:55:46 -06:00
parent ed5bd360b4
commit a2e4c2fad6
7 changed files with 190 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
using System;
using PepperDash.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,8 +11,14 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
/// <summary>
/// Describes a device that has selectable inputs
/// </summary>
public interface IHasInputs
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>\
/// <example>
/// See MockDisplay for example implemntation
/// </example>
public interface IHasInputs<TKey, TSelector>: IKeyName
{
ISelectableItems<string> Inputs { get; }
ISelectableItems<TKey> Inputs { get; }
void SetInput(TSelector selector);
}
}

View File

@@ -1,4 +1,5 @@
using System;
using PepperDash.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,7 +11,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
/// Describes a device that has selectable surround sound modes
/// </summary>
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>
public interface IHasSurroundSoundModes<TKey>
public interface IHasSurroundSoundModes<TKey>: IKeyName
{
ISelectableItems<TKey> SurroundSoundModes { get; }
}

View File

@@ -13,7 +13,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
event EventHandler ItemUpdated;
[JsonProperty("isSelected")]
bool IsSelected { get; }
bool IsSelected { get; set; }
void Select();
}
}

View File

@@ -14,9 +14,9 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
event EventHandler CurrentItemChanged;
Dictionary<TKey, ISelectableItem> Items { get; }
Dictionary<TKey, ISelectableItem> Items { get; set; }
[JsonProperty("currentItem")]
string CurrentItem { get; }
string CurrentItem { get; set; }
}
}