From 9c33e4ccb90fae87a614abd2ed1ab034d3b7a13d Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 26 三月 2021 11:26:01 +0800
Subject: [PATCH] 2021-03-26 1.对接接口优化。
---
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index 9dd0b4b..9eaca20 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -102,10 +102,10 @@
break;
}
- var powerLowTipAttr = function.status.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
+ var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
if (powerLowTipAttr != null)
{
- if (powerLowTipAttr.value.ToLower() == "low")
+ if (powerLowTipAttr.state.ToLower() == "low")
{
Button btnTipPowerLow = new Button()
{
@@ -130,7 +130,7 @@
}
else
{
- if (function.spk == SPK.ClothesHanger)
+ if (function.spk == SPK.ClothesHanger)//鏅捐。鏋�
{
btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerGrayIcon.png";
ClothesHangerFragment();
@@ -184,6 +184,15 @@
switch (function.spk)
{
case SPK.AcStandard:
+ btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
+ LoadLastStatesButton();
+ break;
+ }
+ break;
+ case FunctionCategory.IR:
+ switch(function.spk)
+ {
+ case SPK.AcIr:
btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
LoadLastStatesButton();
break;
@@ -331,7 +340,7 @@
ProgressTextColor = CSS_Color.FirstLevelTitleColor,
ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
MaxValue = 100,
- Progress = (function as Light).brightness,
+ Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.BatteryState)),
Tag = function.sid + "_DimmerBar",
SeekBarPadding = Application.GetRealWidth(20),
};
@@ -370,7 +379,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "off",
+ IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0",
Tag = function.sid + "_off"
};
bodyDiv.AddChidren(btnCurtainClose);
@@ -384,7 +393,6 @@
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png",
Tag = function.sid + "_stop",
- IsSelected = function.trait_on_off.curValue.ToString() == "stop"
};
bodyDiv.AddChidren(btnCurtainStop);
@@ -397,10 +405,10 @@
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
Tag = function.sid + "_on",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0"
};
bodyDiv.AddChidren(btnCurtainOpen);
- LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain);
+ LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function);
#endregion
}
/// <summary>
@@ -411,7 +419,7 @@
#region ClothesHanger
var btnClothesHangerUp = new Button()
{
- X = Application.GetRealWidth(163),
+ X = Application.GetRealWidth(233),
Y = Application.GetRealHeight(58),
Width = Application.GetMinRealAverage(32),
Height = Application.GetMinRealAverage(32),
@@ -430,7 +438,7 @@
SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1On.png",
};
bodyDiv.AddChidren(btnClothesHangerDown);
- LoadEvent_ControlClothesHanger(function, btnClothesHangerDown, btnClothesHangerUp);
+ LoadEvent_ControlClothesHanger(function, btnClothesHangerUp, btnClothesHangerDown);
#endregion
--
Gitblit v1.8.0