| | |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = humiAttr.state, curValue = humiAttr.curValue } }, |
| | | }; |
| | | humiSensorList.Add(newTemp); |
| | | humiSensorList.Add(newTemp);//020103CF594C3E00051F0001051F// 1650546588519424001 |
| | | } |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "temperature"); |
| | | if (tempAttr != null) |
| | |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } }, |
| | | }; |
| | | tempSensorList.Add(newTemp); |
| | | tempSensorList.Add(newTemp);//020103CF594C3E00051F0001051F |
| | | } |
| | | } |
| | | |
| | |
| | | foreach (var temp in tempSensorList) |
| | | { |
| | | double tempValue = 0; |
| | | if (temp.GetAttribute("temperature") != null) |
| | | double.TryParse(temp.GetAttrState("temperature"), out tempValue); |
| | | else |
| | | double.TryParse(temp.GetAttrState("value"), out tempValue); |
| | | if (tempValue > 0) |
| | | { |
| | | tempTotalValues += tempValue; |
| | |
| | | foreach (var humi in humiSensorList) |
| | | { |
| | | double humiValue = 0; |
| | | if (humi.GetAttribute("temperature") != null) |
| | | double.TryParse(humi.GetAttrState("humidity"), out humiValue); |
| | | else |
| | | double.TryParse(humi.GetAttrState("value"), out humiValue); |
| | | if (humiValue > 0) |
| | | { |
| | | humiTotalValues += humiValue; |
| | |
| | | try |
| | | { |
| | | int index = 0; |
| | | var list = FunctionList.List.GetDeviceFunctionList(); |
| | | var list = new List<Function>(); |
| | | list.AddRange(FunctionList.List.GetDeviceFunctionList()); |
| | | list.AddRange(FunctionList.List.groupControls);//加入群控 |
| | | foreach (var function in list) |
| | | { |
| | | //音乐模块有主从关系,需要特殊处理 |
| | |
| | | btnState.Text = function.lastState; |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | } |
| | | |
| | | else if (function.spk == SPK.VideoDoorLock) |
| | | { |
| | | btnIcon.UnSelectedImagePath = UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon(UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.collect); |
| | | //btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | } |
| | | else if (function.spk == SPK.GroupControl) |
| | | { |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/lightswitch_blue.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/lightswitch_white.png"; |
| | | } |
| | | else |
| | | { |
| | | Button btnSwitch; |
| | |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | }; |
| | | view.AddChidren(btnSwitch); |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | LoadEvent_SwitchFunction(function, btnSwitch); |
| | |
| | | }; |
| | | |
| | | |
| | | var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone); |
| | | var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.collect,()=> { |
| | | this.LoadDeviceFunctionControlZone();//删除设备后重新刷新UI |
| | | }); |
| | | view.MouseUpEventHandler = skipControlPageEvent; |
| | | btnName.MouseUpEventHandler = skipControlPageEvent; |
| | | btnIcon.MouseUpEventHandler = skipControlPageEvent; |
| | |
| | | |
| | | LoadEvent_ControlScene(btnCoverd, btnName, btnZone, btnShowDelay, scene); |
| | | |
| | | btnSettingIcon.MouseUpEventHandler = (sender, e) => { |
| | | Action backAction = () => { |
| | | btnSettingIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action backAction = () => |
| | | { |
| | | //LoadSceneFunctionControlZone(); |
| | | }; |
| | | Action refreshAction = () => { |
| | | Action refreshAction = () => |
| | | { |
| | | btnName.Text = scene.name; |
| | | btnZone.Text = scene.GetRoomListName(); |
| | | //view.BackgroundImagePath = (scene as Scene).ImagePath; |