| | |
| | | /// 发送获取灯光状态命令
|
| | | /// </summary>
|
| | | /// <param name="device">窗帘</param>
|
| | | private void SendLevelStatuComand(CommonDevice device)
|
| | | public void SendLevelStatuComand(CommonDevice device)
|
| | | {
|
| | | if (device == null) |
| | | { |
| | |
| | | var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
|
| | | jObject.Add("Data", data);
|
| | | device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString());
|
| | | }
|
| | |
|
| | | #endregion |
| | |
|
| | | #region ■ 色温灯_____________________________ |
| | |
|
| | | /// <summary> |
| | | /// 发送获取色温灯状态命令 |
| | | /// </summary> |
| | | /// <param name="device"></param> |
| | | public void SendColorTemperatureLightStatuComand(CommonDevice device) |
| | | { |
| | | if (device == null) |
| | | { |
| | | return; |
| | | } |
| | | var colorDevice = (ColorTemperatureLight)device; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | colorDevice.ReadOnOffStatus(); |
| | | System.Threading.Thread.Sleep(300);
|
| | | colorDevice.ReadLevel();
|
| | | System.Threading.Thread.Sleep(300);
|
| | | colorDevice.ReadColorTemperature(); |
| | | if (LocalDevice.Current.IsMiniLight(device) == true)
|
| | | {
|
| | | //mini夜灯需要读取蜂鸣器状态
|
| | | System.Threading.Thread.Sleep(300);
|
| | | colorDevice.ReadBuzzerStatu();
|
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | #endregion |