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:
Neil Dorin
2018-05-17 12:33:20 -06:00
parent b44613b91f
commit c88b259c71
22 changed files with 846 additions and 394 deletions

View File

@@ -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>
///

View File

@@ -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; }
}
}
}