| | |
| | | /// </summary> |
| | | public void SearchLoaclGateway() |
| | | { |
| | | MainPage.Log($"搜索本地网关列表,网关类型:{DB_ResidenceData.Instance.GatewayType}"); |
| | | if (MainPage.InternetStatus == 0) |
| | | return; |
| | | OpenUdp(DB_ResidenceData.Instance.GatewayType == 0 ? 6000 : 8585); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | } |
| | | System.Threading.Thread.Sleep(500); |
| | | } |
| | | if (!GatewayOnline)//网关不在线的时候才可尝试远程连接 |
| | | { |
| | | Ins.IsRemote = true; |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | if (!GatewayOnline)//网关不在线的时候才可尝试远程连接 |
| | | { |
| | | Ins.IsRemote = true; |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | break; |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | break; |
| | | case SPK.LightCCT:
|
| | | var lightCCT = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid); |
| | | if (lightCCT != null) |
| | | { |
| | | localObj = lightCCT; |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | var localAttr = lightCCT.attributes.Find((obj) => obj.key == attr.key); |
| | | if (localAttr != null) |
| | | { |
| | | localAttr.curValue = attr.value; |
| | | } |
| | | } |
| | | lightCCT.lastState = Language.StringByID(StringId.Brightness) + " : " + lightCCT.brightness + "%"; |
| | | DimmerPage.UpdataStates(lightCCT); |
| | | } |
| | | break; |
| | | case SPK.CurtainSwitch: |
| | | var curtain = FunctionList.List.curtains.Find((obj) => obj.sid == updateTemp.sid); |