mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 10:15:01 +00:00
Significant refactoring of DeviceFactory for touchpanel device building. Moved SetupHeaderButtons() out of AV driver classes and into new EssentialsHeaderDriver class.
This commit is contained in:
@@ -28,6 +28,15 @@ namespace PepperDash.Essentials.Core
|
||||
BoolFeedback MuteFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A class that implements this contains a reference to a current IBasicVolumeControls device.
|
||||
/// The class may have multiple IBasicVolumeControls.
|
||||
/// </summary>
|
||||
public interface IHasCurrentVolumeControls
|
||||
{
|
||||
IBasicVolumeControls CurrentVolumeControls { get; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -8,16 +8,51 @@ using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Shades
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that contains the shades to be controlled in a room
|
||||
/// </summary>
|
||||
public class ShadeController : Device, IShades
|
||||
{
|
||||
ShadeControllerConfigProperties Config;
|
||||
|
||||
public List<ShadeBase> Shades { get; private set; }
|
||||
|
||||
public ShadeController(string key, string name)
|
||||
public ShadeController(string key, string name, ShadeControllerConfigProperties config)
|
||||
: base(key, name)
|
||||
{
|
||||
Config = config;
|
||||
|
||||
Shades = new List<ShadeBase>();
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
foreach (var shadeConfig in Config.Shades)
|
||||
{
|
||||
var shade = DeviceManager.GetDeviceForKey(shadeConfig.Key) as ShadeBase;
|
||||
|
||||
if (shade != null)
|
||||
{
|
||||
AddShade(shade);
|
||||
}
|
||||
}
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
void AddShade(ShadeBase shade)
|
||||
{
|
||||
Shades.Add(shade);
|
||||
}
|
||||
}
|
||||
|
||||
public class ShadeControllerConfigProperties
|
||||
{
|
||||
public List<ShadeConfig> Shades { get; set; }
|
||||
|
||||
|
||||
public class ShadeConfig
|
||||
{
|
||||
public string Key { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user