Exemple #1
0
        public void SetWorkflow(LinkDeviceActionType action)
        {
            LinkRequest linkRequest = new LinkRequest()
            {
                MessageID = RandomGenerator.BuildRandomString(12),
                Actions   = new List <LinkActionRequest>()
                {
                    new LinkActionRequest()
                    {
                        Action = LinkAction.DALAction,
                        DeviceActionRequest = new LinkDeviceActionRequest()
                        {
                            DeviceAction = action
                        },
                        DeviceRequest = new LinkDeviceRequest()
                        {
                            DeviceIdentifier = new XO.Device.LinkDeviceIdentifier()
                            {
                                Manufacturer = TargetDevices[0].DeviceInformation?.Manufacturer,
                                Model        = TargetDevices[0].DeviceInformation?.Model,
                                SerialNumber = TargetDevices[0].DeviceInformation?.SerialNumber
                            }
                        }
                    }
                }
            };

            SendDeviceCommand(JsonConvert.SerializeObject(linkRequest));
        }
Exemple #2
0
 public Task Command(LinkDeviceActionType action)
 {
     DeviceStateManager.SetWorkflow(action);
     _ = Task.Run(() => DeviceStateManager.LaunchWorkflow());
     return(Task.CompletedTask);
 }