From c0c734d7a84cf7105401878ffc4b64cbb67621d1 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 01 十一月 2024 15:02:24 +0800
Subject: [PATCH] 更新极光Sdk531
---
HDL_ON/Entity/Function/Scene.cs | 221 +++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 167 insertions(+), 54 deletions(-)
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index a6b5568..9b57845 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -3,6 +3,7 @@
using HDL_ON.Common;
using HDL_ON.DAL.Server;
using HDL_ON.UI;
+using HDL_ON.UI.UI2.Intelligence.Automation;
using Shared;
namespace HDL_ON.Entity
@@ -86,6 +87,14 @@
/// 鏄惁鍏佽鍒犻櫎
/// </summary>
public bool can_delete = true;
+ /// <summary>
+ /// 鏄惁鍏佽缂栬緫
+ /// </summary>
+ public bool can_edit = true;
+ /// <summary>
+ /// 鏄惁鏄綉鍏虫湰鍦板満鏅�
+ /// </summary>
+ public bool local = false;
/// <summary>
/// 鍒涘缓璇ュ満鏅殑鐢ㄦ埛ID
@@ -151,6 +160,7 @@
/// 閰嶅悎璞嗚眴淇敼浜戠鏁版嵁
/// 璋冭瘯瀹濄�乷n pro鍜屽钩鍙板搴�
/// </summary>
+ [Newtonsoft.Json.JsonIgnore]
public List<SceneImageInfo> OssSceneImages = new List<SceneImageInfo>()
{
new SceneImageInfo
@@ -430,6 +440,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);
@@ -559,8 +570,24 @@
/// <returns></returns>
private Function ConvertFunctionObject()
{
- var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
- return localFunction;
+ Function temp = null;
+ if (type == "7")
+ {
+ var logic = Logic.LogicList.Find((obj) => obj.sid == sid);
+ if (logic != null) {
+ temp = new Function();
+ temp.name = logic.name;
+ }
+ }
+ else
+ {
+ temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
+ if (temp == null)
+ {
+ temp = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+ }
+ }
+ return temp;
}
@@ -571,65 +598,121 @@
public string GetFunctionScnenInfo()
{
var sceneFunctionInfo = "";
- foreach (var sfs in status)
+ if (type == "7")
{
- if (sfs.key == FunctionAttributeKey.OnOff)
+ foreach (var sfs in status)
{
- if (sfs.value == "off")
+ if (sfs.key == "enable")
{
- return Language.StringByID(StringId.Close);
+ if (sfs.value == "true")
+ return Language.StringByID(StringId.OpenArm);
+ else
+ {
+ return Language.StringByID(StringId.Close);
+ }
}
}
}
- sceneFunctionInfo += Language.StringByID(StringId.Open) + " ";
+ else
+ {
+ foreach (var sfs in status)
+ {
+ if (sfs.key == FunctionAttributeKey.OnOff)
+ {
+ if (sfs.value == "off")
+ {
+ return Language.StringByID(StringId.Close);
+ }
+ }
+ }
+ sceneFunctionInfo += Language.StringByID(StringId.Open) + " ";
- var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
- var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
- var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
- if (modeState != null)
- {
- sceneFunctionInfo += modeState.GetValueText() + " ";
- }
- if (tempState != null)
- {
- sceneFunctionInfo += tempState.GetValueText() + " ";
- sceneFunctionInfo += tempState.GetUintString();
- }
- if (fanState != null)
- {
- sceneFunctionInfo += fanState.GetValueText() + " ";
- }
- var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
- if (briState != null)
- {
- sceneFunctionInfo += briState.value + "%" + " ";
- }
- var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
- if (perState != null)
- {
- sceneFunctionInfo += perState.value + "%" + " ";
- }
- var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT);
- if (cctState != null)
- {
- sceneFunctionInfo += cctState.value + "K" + " ";
- }
- var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB);
- if (rgbState != null)
- {
- //sceneFunctionInfo += new cctState.value + "%" + " ";
- }
+ var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
+ var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
+ var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
+ ////娴蜂俊鐢佃鐘舵��
+ //var hisenseTvState = status.Find((obj) => obj.key == "wol");
+ //if(hisenseTvState != null)
+ //{
+ //}
+ if (modeState != null)
+ {
+ sceneFunctionInfo += modeState.GetValueText() + " ";
+ }
+ if (tempState != null)
+ {
+ sceneFunctionInfo += tempState.GetValueText();
+ sceneFunctionInfo += tempState.GetUintString() + " ";
+ }
+ if (fanState != null)
+ {
+ sceneFunctionInfo += fanState.GetValueText() + " ";
+ }
+ var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
+ if (briState != null)
+ {
+ sceneFunctionInfo += briState.value + "%" + " ";
+ }
+ var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
+ if (perState != null)
+ {
+ sceneFunctionInfo += perState.value + "%" + " ";
+ }
+ var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT);
+ if (cctState != null)
+ {
+ sceneFunctionInfo += cctState.value + "K" + " ";
+ }
+ var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB);
+ if (rgbState != null)
+ {
+ //sceneFunctionInfo += new cctState.value + "%" + " ";
+ }
- var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
- if (perAngle != null)
- {
- sceneFunctionInfo += " " + perState.value + "掳";
+ var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
+ if (perAngle != null)
+ {
+ 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
+ /// 鑷姩鍖�=7
+ ///
+ /// </summary>
+ public string type = "0";
}
/// <summary>
@@ -646,6 +729,7 @@
/// <summary>
/// 灞炴�х殑鍊煎垪琛�
/// </summary>
+ [Newtonsoft.Json.JsonIgnore]
public List<string> valueList = new List<string>();
/// <summary>
/// 灞炴�у悕绉版樉绀烘枃鏈�
@@ -663,7 +747,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);
@@ -695,22 +779,36 @@
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;
}
+ [Newtonsoft.Json.JsonIgnore]
+ 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:
@@ -750,6 +848,7 @@
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:
@@ -838,6 +937,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