| | |
| | | instance.SaveResidenceData(); |
| | | } |
| | | |
| | | new Light() |
| | | { |
| | | sid = "030101123456780202010005ABCD", |
| | | name = "灯光1", |
| | | attributes = new List<FunctionAttributes>() { |
| | | new FunctionAttributes { key="on_off", max=100,min = 0, value= new List<string> { "on","off"} }, |
| | | }, |
| | | roomIds = new List<string>() { "0001" }, |
| | | bus_Data = new BusData |
| | | { |
| | | addresses = "2A06", |
| | | loopId = 1, |
| | | }, |
| | | }.SaveFunctionData(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | Rooms = null; |
| | | ins_OidList = null; |
| | | functionList = null; |
| | | HomeGateway = null; |
| | | if (MainPage.IsRemote) |
| | | { |
| | | DAL.Mqtt.MqttClient.DisConnectRemote("退出登录,或者切换住宅"); |
| | |
| | | _functionList = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新住宅里面的搜索设备状态 |
| | | /// </summary> |
| | | public void RefreshResidenceFunctionStatus() |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | foreach (var function in functionList.GetAllDeviceFunctionList()) |
| | | { |
| | | Thread.Sleep(100); |
| | | switch (function.functionCategory) |
| | | { |
| | | case FunctionCategory.Light: |
| | | case FunctionCategory.Electrical: |
| | | case FunctionCategory.SwitchDevice: |
| | | case FunctionCategory.Curtain: |
| | | case FunctionCategory.Thermostat: |
| | | if (DB_ResidenceData.residenceData.GatewayType == 0) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"Refresh Residence Function Status Error : {ex.Message}"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |