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

@@ -16,21 +16,32 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
/// </summary>
public class RelayControlledShade : ShadeBase
{
RelayControlledShadeConfigProperties Config;
ISwitchedOutput OpenRelay;
ISwitchedOutput StopRelay;
ISwitchedOutput CloseRelay;
int RelayPulseTime;
public RelayControlledShade(string key, string name, RelayControlledShadeConfigProperties props)
public RelayControlledShade(string key, string name, RelayControlledShadeConfigProperties config)
: base(key, name)
{
RelayPulseTime = props.RelayPulseTime;
//Create ISwitchedOutput objects based on props
Config = config;
OpenRelay = GetSwitchedOutputFromDevice(props.Relays.Open);
StopRelay = GetSwitchedOutputFromDevice(props.Relays.Stop);
CloseRelay = GetSwitchedOutputFromDevice(props.Relays.Close);
RelayPulseTime = Config.RelayPulseTime;
}
public override bool CustomActivate()
{
//Create ISwitchedOutput objects based on props
OpenRelay = GetSwitchedOutputFromDevice(Config.Relays.Open);
StopRelay = GetSwitchedOutputFromDevice(Config.Relays.Stop);
CloseRelay = GetSwitchedOutputFromDevice(Config.Relays.Close);
return base.CustomActivate();
}
public override void Open()