From 5efaaab958a0f4a91ad9d76b5d5fea0ea3fc3f41 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 01 十二月 2020 16:24:19 +0800
Subject: [PATCH] 2020-12-01 1.请求路径修改。 2.切换住宅或者查询住宅列表增加获取网关列表。 3.房间增加默认图片选择、比例调整为16:9。4.优化图片裁剪。
---
HDL_ON/Entity/Function/Function.cs | 60 +++++++++++++++++++++++++++++++-----------------------------
1 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 909a146..a602940 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -54,7 +54,7 @@
/// 濡傦細鏄疉C鍔熻兘锛氱壒鎬э細on_off,mode,fan,temperature
/// attri
/// </summary>
- public List<Trait> function = new List<Trait>();
+ public List<FunctionAttributes> function = new List<FunctionAttributes>();
/// <summary>
/// 鎴块棿ID鍒楄〃
@@ -145,27 +145,27 @@
[Newtonsoft.Json.JsonIgnore]
public string lastState = "";
- Trait _trait_on_off;
+ FunctionAttributes _trait_on_off;
[Newtonsoft.Json.JsonIgnore]
- public Trait trait_on_off
+ public FunctionAttributes trait_on_off
{
get
{
if (_trait_on_off == null)
{
- _trait_on_off = function.Find((obj) => obj.name == "on_off");
+ _trait_on_off = function.Find((obj) => obj.key == "on_off");
//鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂��
if (_trait_on_off == null)
{
- _trait_on_off = new Trait()
+ _trait_on_off = new FunctionAttributes()
{
- name = "on_off",
- value_key = new List<string> { "on", "off" },
+ key = "on_off",
+ value = new List<string> { "on", "off" },
max = 1,
min = 0,
};
}
- _trait_on_off.value = "on";
+ _trait_on_off.curValue = "on";
}
return _trait_on_off;
}
@@ -219,8 +219,10 @@
{
var findRoom = DB_ResidenceData.rooms.Find(obj => obj.sid == roomId);
if (findRoom == null)
+ {
continue;
- if(roomNameList != "")
+ }
+ if (roomNameList != "")
{
roomNameList += ",";
}
@@ -311,16 +313,16 @@
/// 鍔熻兘灞炴��
/// 灞炴�у瓧娈佃В鏋愶細attri :灞炴�у唴瀹癸紝value 灞炴�х殑鍊硷紝max 鏈�澶у�� min 鏈�灏忓��
/// </summary>
- public class Trait
+ public class FunctionAttributes
{
/// <summary>
- /// 灞炴�у悕绉�
+ /// 灞炴�ч敭鍚�
/// </summary>
- public string name;
+ public string key;
/// <summary>
/// 灞炴�х殑鍊煎垪琛�
/// </summary>
- public List<string> value_key = new List<string>();
+ public List<string> value = new List<string>();
/// <summary>
/// 鏈�澶у��
/// </summary>
@@ -338,7 +340,7 @@
/// <summary>
/// 褰撳墠鍊�
/// </summary>
- public object value = new object();
+ public object curValue = new object();
//----app鑷畾涔�
@@ -356,7 +358,7 @@
return _uintString;
}
var us = "";
- switch (name)
+ switch (key)
{
case "temperature":
case "set_temperature":
@@ -381,7 +383,7 @@
get
{
string text = "";
- switch (name)
+ switch (key)
{
case "on_off":
text = Language.StringByID(StringId.OnOff);
@@ -445,7 +447,7 @@
/// </summary>
public string GetCurValueText()
{
- return GetValueText(value.ToString());
+ return GetValueText(curValue.ToString());
}
/// <summary>
@@ -456,7 +458,7 @@
{
string text = "";
value = value.Replace("{}", "");
- switch (name)
+ switch (key)
{
case "on_off":
text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF);
@@ -467,7 +469,7 @@
case "percent":
if (value == "")
{
- this.value = this.min;
+ this.curValue = this.min;
text = this.min.ToString();
}
else
@@ -512,21 +514,21 @@
text = Language.StringByID(StringId.Timer);
break;
default:
- if (this.value_key.Contains("cool"))
+ if (this.value.Contains("cool"))
{
- this.value = "cool";
+ this.curValue = "cool";
text = Language.StringByID(StringId.Cool);
}
- else if (this.value_key.Contains("day"))
+ else if (this.value.Contains("day"))
{
- this.value = "day";
+ this.curValue = "day";
text = Language.StringByID(StringId.Day);
}
else
{
- foreach (var v in this.value_key)
+ foreach (var v in this.value)
{
- this.value = v;
+ this.curValue = v;
text = GetCurValueText();
}
}
@@ -549,16 +551,16 @@
text = Language.StringByID(StringId.Auto);
break;
default:
- if (this.value_key.Contains("low"))
+ if (this.value.Contains("low"))
{
- this.value = "low";
+ this.curValue = "low";
text = Language.StringByID(StringId.LowWindSpeed);
}
else
{
- foreach (var v in this.value_key)
+ foreach (var v in this.value)
{
- this.value = v;
+ this.curValue = v;
text = GetCurValueText();
}
}
--
Gitblit v1.8.0