From 87d8d4adb1dd948c2beebdc9c4b84a7d426b60cc Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期一, 25 九月 2023 10:55:08 +0800
Subject: [PATCH] 2023年09月25日10:54:27
---
HDL_ON/Entity/Function/Scene.cs | 91 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 81 insertions(+), 10 deletions(-)
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index 074f835..c2844b4 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -151,6 +151,7 @@
/// 閰嶅悎璞嗚眴淇敼浜戠鏁版嵁
/// 璋冭瘯瀹濄�乷n pro鍜屽钩鍙板搴�
/// </summary>
+ [Newtonsoft.Json.JsonIgnore]
public List<SceneImageInfo> OssSceneImages = new List<SceneImageInfo>()
{
new SceneImageInfo
@@ -430,6 +431,7 @@
{
var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
+ return revPack.Code;
}
var scenes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString());
var tempScene = scenes.Find((obj) => obj.sid == sid);
@@ -560,6 +562,10 @@
private Function ConvertFunctionObject()
{
var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
+ if(localFunction == null)
+ {
+ localFunction = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+ }
return localFunction;
}
@@ -592,8 +598,8 @@
}
if (tempState != null)
{
- sceneFunctionInfo += tempState.GetValueText() + " ";
- sceneFunctionInfo += tempState.GetUintString();
+ sceneFunctionInfo += tempState.GetValueText();
+ sceneFunctionInfo += tempState.GetUintString() + " ";
}
if (fanState != null)
{
@@ -624,12 +630,43 @@
var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
if (perAngle != null)
{
- sceneFunctionInfo += " " + perState.value + "掳";
+ sceneFunctionInfo += " " + perAngle.value + "掳";
+ }
+
+ var perSetVolume = status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume);
+ if (perSetVolume != null)
+ {
+ sceneFunctionInfo += " " + perSetVolume.value;
+ }
+
+ var perSignal = status.Find((obj) => obj.key == FunctionAttributeKey.Signal);
+ if (perSignal != null)
+ {
+ var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface();
+ string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value);
+ sceneFunctionInfo += " " + key;
+ }
+
+ var perVolume =status.Find((obj) => obj.key == FunctionAttributeKey.Volume);
+ if (perVolume != null)
+ {
+ sceneFunctionInfo += " " + perVolume.value;
+ }
+
+ var perSongName =status.Find((obj) => obj.key == FunctionAttributeKey.SongName);
+ if (perSongName != null)
+ {
+ sceneFunctionInfo += " " + perSongName.value;
}
return sceneFunctionInfo;
}
-
+ /// <summary>
+ /// 璁惧
+ /// 鍦烘櫙 =scene
+ /// 缇ゆ帶=5
+ /// </summary>
+ public string type = "0";
}
/// <summary>
@@ -663,7 +700,7 @@
text = Language.StringByID(StringId.Brightness);
break;
case FunctionAttributeKey.RGB:
- text = Language.StringByID(StringId.ColorValue);
+ text = "RGB";// Language.StringByID(StringId.ColorValue);
break;
case FunctionAttributeKey.Mode:
text = Language.StringByID(StringId.Mode);
@@ -692,22 +729,38 @@
case "angle":
text = Language.StringByID(StringId.Angle);
break;
+ case "security":
+ text = Language.StringByID(StringId.DeploymentStatus);
+ break;
+ case FunctionAttributeKey.SetVolume:
+ text = Language.StringByID(StringId.yinliang);
+ break;
+ case FunctionAttributeKey.Signal:
+ text = Language.StringByID(StringId.xinhaoyuan);
+ break;
+ case FunctionAttributeKey.Volume:
+ text = Language.StringByID(StringId.yinliang);
+ break;
+ case FunctionAttributeKey.SongName:
+ text = Language.StringByID(StringId.tishiyin);
+ break;
}
return text;
}
+ public string UintString = "";
/// <summary>
/// 灞炴�у�煎崟浣�
/// </summary>
- public string GetUintString(string inputKey = "")
+ public string GetUintString()
{
+ if (!string.IsNullOrEmpty(UintString) && UintString != "{}")
+ {
+ return UintString;
+ }
var us = "";
var swithchString = key;
- if (!string.IsNullOrEmpty(inputKey))
- {
- swithchString = inputKey;
- }
switch (swithchString)
{
case FunctionAttributeKey.SetTemp:
@@ -743,7 +796,11 @@
string text = "";
switch (key)
{
+ case FunctionAttributeKey.Security:
+ text = catchString == "true" ? Language.StringByID(StringId.Defense) : Language.StringByID(StringId.Undefense);
+ break;
case FunctionAttributeKey.OnOff:
+ case FunctionAttributeKey.Colorful:
text = catchString == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF);
break;
case FunctionAttributeKey.SetTemp:
@@ -832,6 +889,20 @@
case "auto":
text = Language.StringByID(StringId.Auto);
break;
+ case FunctionAttributeKey.Signal:
+ var p = new UI.UI2.Intelligence.Automation.PublicInterface();
+ var dic = p.GetHisenseSignalSourceDic();
+ text = p.GetKey(dic, value);
+ break;
+ case FunctionAttributeKey.SetVolume:
+ text = value;
+ break;
+ case FunctionAttributeKey.Volume:
+ text = value;
+ break;
+ case FunctionAttributeKey.SongName:
+ text = value;
+ break;
}
return text;
}
--
Gitblit v1.8.0