From f4c86f68b900bd506ef7214b2ae9bd23a9d2ffa8 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期六, 19 十二月 2020 17:48:11 +0800
Subject: [PATCH] 完成筛选房间的功能
---
HDL_ON/Entity/Function/AC.cs | 57 ++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 48 insertions(+), 9 deletions(-)
diff --git a/HDL_ON/Entity/Function/AC.cs b/HDL_ON/Entity/Function/AC.cs
old mode 100644
new mode 100755
index a80f15e..a24c624
--- a/HDL_ON/Entity/Function/AC.cs
+++ b/HDL_ON/Entity/Function/AC.cs
@@ -6,12 +6,12 @@
public class AC : Function
{
/*
- * 绌鸿皟锛歵rait: [switch, mode, fan, set_temperature, swing, lock]
+ * 绌鸿皟锛歵rait: [switch, mode, fan, set_temp, swing, lock]
* 灞炴�� 鎻忚堪
* on_off on/off
* mode mode: auto, cool, heat, dry, fan
* fan high, medium, low, auto
- * set_temperature up,down,value
+ * set_temp up,down,value
* swing up/down/left/right
* lock boolean (Lock閿佸畾鎺у埗)
*/
@@ -194,7 +194,8 @@
min = 0,
};
}
- _trait_mode.curValue = _trait_mode.value.Count > 0 ? _trait_mode.value[0] : "";
+ if (_trait_mode.curValue.ToString() == "{}")
+ _trait_mode.curValue = "cool";
}
return _trait_mode;
}
@@ -218,9 +219,11 @@
value = new List<string> { "high", "medium", "low", "auto" },
max = 3,
min = 0,
+ curValue = "high"
};
}
- _trait_fan.curValue = _trait_fan.value.Count > 0 ? _trait_fan.value[0] : "";
+ if (_trait_fan.curValue.ToString() == "{}")
+ _trait_fan.curValue = "high";
}
return _trait_fan;
}
@@ -237,19 +240,25 @@
{
if (_trait_temp == null)
{
- _trait_temp = attributes.Find((obj) => obj.key == "set_temperature");
+ _trait_temp = attributes.Find((obj) => obj.key == "set_temp");
//鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂��
if (_trait_temp == null)
{
_trait_temp = new FunctionAttributes()
{
- key = "set_temperature",
+ key = "set_temp",
value = new List<string> { },
max = 32,
min = 16,
};
}
- _trait_temp.curValue = 16;
+ if (_trait_temp.curValue.ToString() == "{}")
+ _trait_temp.curValue = 16;
+ }
+ //if (_trait_temp.curValue.ToString().Length > 3)
+ {
+ var vv = Convert.ToDouble(_trait_temp.curValue);
+ _trait_temp.curValue = Convert.ToInt32(vv);
}
return _trait_temp;
}
@@ -275,7 +284,8 @@
min = 0,
};
}
- _trait_swting.curValue = _trait_swting.value.Count > 0 ? _trait_swting.value[trait_mode.min] : "";
+ if (_trait_swting.curValue.ToString() == "{}")
+ _trait_swting.curValue = "up";
}
return _trait_swting;
}
@@ -299,11 +309,40 @@
}
}
}
+ FunctionAttributes _trait_IndoorTemp;
/// <summary>
/// 瀹ゅ唴娓╁害
/// </summary>
[Newtonsoft.Json.JsonIgnore]
- public int indoorTemp = 20;
+ public FunctionAttributes trait_IndoorTemp
+ {
+ get
+ {
+ if (_trait_IndoorTemp == null)
+ {
+ _trait_IndoorTemp = attributes.Find((obj) => obj.key == FunctionAttributeKey.IndoorTemp);
+ //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂��
+ if (_trait_IndoorTemp == null)
+ {
+ _trait_IndoorTemp = new FunctionAttributes()
+ {
+ key = FunctionAttributeKey.IndoorTemp,
+ value = new List<string> { },
+ max = 30,
+ min = 0,
+ };
+ }
+ if (_trait_IndoorTemp.curValue.ToString() == "{}")
+ _trait_IndoorTemp.curValue = 0;
+ }
+ //if (_trait_IndoorTemp.curValue.ToString().Length > 3)
+ {
+ var vv = Convert.ToDouble(_trait_IndoorTemp.curValue);
+ _trait_IndoorTemp.curValue = Convert.ToInt32(vv);
+ }
+ return _trait_IndoorTemp;
+ }
+ }
/// <summary>
/// 褰撳墠妯″紡鐨刬con璺緞
--
Gitblit v1.8.0