| | |
| | | if (device == null) { |
| | | continue; |
| | | } |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.UpdataCurtainModelStutas, device.SubnetID, device.DeviceID, new byte [] { 1, (byte)device.Status }); |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.UpdataCurtainModelStutas, device.SubnetID, device.DeviceID, new byte [] { 17, (byte)device.CurtainProress }); |
| | | } else if (common.Type == DeviceType.CurtainTrietex) { |
| | | var device = Newtonsoft.Json.JsonConvert.DeserializeObject<CurtainTrietex> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (deviceFilePath))); |
| | | if (device == null) { |
| | | continue; |
| | | } |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.UpdataCurtainModelStutas, device.SubnetID, device.DeviceID, new byte [] { 1, (byte)device.Status }); |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.UpdataCurtainModelStutas, device.SubnetID, device.DeviceID, new byte [] { 17, (byte)device.CurtainProress }); |
| | | } else if (common.Type == DeviceType.HVAC || common.Type == DeviceType.ACInfrared) { |
| | | var device = Newtonsoft.Json.JsonConvert.DeserializeObject<HVAC> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (deviceFilePath))); |
| | | if (device == null) { |
| | |
| | | } |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.SetScene, device.SubnetID, device.DeviceID, new byte [] { |
| | | device.AreaID,device.AreaSceneID}); |
| | | } else if (common.Type == DeviceType.UniversalDevice) {//2020-09-02 增加通用开关 |
| | | var device = Newtonsoft.Json.JsonConvert.DeserializeObject<UniversalDevice> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (deviceFilePath))); |
| | | if (device == null) { |
| | | continue; |
| | | } |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.SetCommonSwitch, device.SubnetID, device.DeviceID, new byte [] { device.SendBytes [0], device.SendBytes [1] }); |
| | | } |
| | | |
| | | try { |
| | |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.SetScene, device.SubnetID, device.DeviceID, new byte [] { |
| | | device.AreaID,device.AreaSceneID}); |
| | | } |
| | | } else if (common.Type == DeviceType.UniversalDevice) {//2020-09-02 增加通用开关 |
| | | var device = Newtonsoft.Json.JsonConvert.DeserializeObject<UniversalDevice> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (deviceFilePath))); |
| | | if (device == null) { |
| | | replyBytes = new byte [] { 0x00 }; |
| | | } else { |
| | | replyBytes = Control.ControlBytesSendHasReturn (Command.SetCommonSwitch, device.SubnetID, device.DeviceID, new byte [] { device.SendBytes [0], device.SendBytes [1] }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | try { |
| | | if (showTip) { |
| | | if (replyBytes == null) { |