| | |
| | | { |
| | | List<string> devicetypelist = new List<string>(); |
| | | devicetypelist.Clear(); |
| | | |
| | | var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput); |
| | | if (lightjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights)); |
| | | } |
| | | var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | | } |
| | | var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch); |
| | | if (onOffSwitchjson != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch)); |
| | | } |
| | | var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock); |
| | | if (doorLock != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock)); |
| | | } |
| | | |
| | | var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice); |
| | | if (curtainjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); |
| | | } |
| | | |
| | | var ac = devicelist.Find((device) => device.Type == DeviceType.Thermostat); |
| | | if (ac != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC)); |
| | | } |
| | | |
| | | var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch); |
| | | if (onOffSwitchjson != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch)); |
| | | } |
| | | |
| | | var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock); |
| | | if (doorLock != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock)); |
| | | } |
| | | |
| | | var airSwitch = devicelist.Find((device) => device.Type == DeviceType.AirSwitch); |
| | | if (airSwitch != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch)); |
| | | } |
| | | |
| | | var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | | } |
| | | |
| | | return devicetypelist; |
| | |
| | | /// <param name="CurrentLogic">当前逻辑</param> |
| | | public async static void SaveLogic(string if_logic, string name, bool tag, Common.Logic CurrentLogic) |
| | | { |
| | | //记录逻辑类型 |
| | | //只是对跳转界面有用,基本没啥用 |
| | | int Type = CurrentLogic.LogicType; |
| | | if (string.IsNullOrEmpty(name)) |
| | | { |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | |
| | | //TipView("添加自动化失败"); |
| | | //return; |
| | | } |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | |
| | | |
| | | if (LogicView.IfString._Logic == if_logic) |
| | | { |
| | | Category.Category.instance?.RefreshBodyView(); |
| | | if (Type == 0) |
| | | { |
| | | |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | //只刷新分类上下滑动view; |
| | | Phone.Category.CategoryMainForm.instance?.RefreshBodyView(); |
| | | // Category.Category.instance?.RefreshBodyView(); |
| | | } |
| | | else if (Type == 2) |
| | | { |
| | | //刷新整个分类; |
| | | //门锁常开模式特殊; |
| | | UserView.UserPage.Instance.ShowCategoryAutoListForm(); |
| | | |
| | | } |
| | | } |
| | | else if (LogicView.IfString._LockLogic == if_logic) |
| | | { |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | var doorLockLogicList = new DoorLockLogic.LockLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(doorLockLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | deviceTarget.Show(str1, str2); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |