private List <BO.DeviceAction> getAction(HmdService.DeviceAction action) { var list = new List <BO.DeviceAction>(3); switch (action.Nom) { case "ON": list.Add(DeviceAction.Get <OnAction>()); break; case "OFF": list.Add(DeviceAction.Get <OffAction>()); break; case "DIM": list.Add(DeviceAction.Get <UpAction>()); list.Add(DeviceAction.Get <DownAction>()); break; case "Read": break; default: list.Add(new RawAction(action)); break; } return(null); }
public NumericDevice() { this.DeviceType = BO.DeviceType.Numeric; this.DisplayType = BO.DisplayType.Numeric; this.Actions = new List <DeviceAction>() { DeviceAction.Get <UpAction>(), DeviceAction.Get <DownAction>(), DeviceAction.Get <OnAction>(), DeviceAction.Get <OffAction>(), DeviceAction.Get <DimAction>() }; }
public OnOffDevice(bool useOpenCloseActions) { this.DeviceType = BO.DeviceType.OnOff; this.DisplayType = BO.DisplayType.Boolean; if (useOpenCloseActions) { this.Actions = new List <DeviceAction>() { DeviceAction.Get <OpenAction>(), DeviceAction.Get <CloseAction>() }; } else { this.Actions = new List <DeviceAction>() { DeviceAction.Get <OnAction>(), DeviceAction.Get <OffAction>() }; } }