| | |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <returns></returns> |
| | | public string GetAttrState(string key) |
| | | public string GetAttrState(string key , string defaultValue = "0") |
| | | { |
| | | //一级查询keyValue值 |
| | | var attrState = attributes.Find((s) => s.key == key.ToString()); |
| | | if (attrState == null) |
| | | { |
| | | return "0"; |
| | | return defaultValue; |
| | | } |
| | | if (string.IsNullOrEmpty(attrState.state)) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | public string name; |
| | | public string name = ""; |
| | | /// <summary> |
| | | /// 设备绑定的homeId |
| | | /// </summary> |
| | | private string _homeId = ""; |
| | | public string homeId |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(_homeId)) |
| | | { |
| | | return DB_ResidenceData.Instance.CurrentRegion.id; |
| | | } |
| | | else |
| | | { |
| | | return _homeId; |
| | | } |
| | | } |
| | | set |
| | | { |
| | | _homeId = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设备ID |
| | | /// 云端负责生成 |
| | |
| | | /// </summary> |
| | | public string modifyTime = ""; |
| | | |
| | | /// <summary> |
| | | /// 扩展信息 |
| | | /// </summary> |
| | | public ExtSet extSet = new ExtSet(); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | //public void |
| | | |
| | | |
| | | /// <summary> |
| | | /// 延时 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string lastState = ""; |
| | | /// <summary> |
| | | /// 获取状态显示文本 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string GetLastStateText() |
| | | { |
| | | var text = ""; |
| | | switch (spk) |
| | | { |
| | | case SPK.HvacCac: |
| | | switch (GetAttrState(FunctionAttributeKey.Mode)) |
| | | { |
| | | case "cool": |
| | | text = Language.StringByID(StringId.Cool); |
| | | break; |
| | | case "heat": |
| | | text = Language.StringByID(StringId.Heat); |
| | | break; |
| | | } |
| | | |
| | | break; |
| | | |
| | | } |
| | | return text; |
| | | } |
| | | |
| | | FunctionAttributes _trait_on_off; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | |
| | | case FunctionAttributeKey.Percent: |
| | | case FunctionAttributeKey.CCT: |
| | | case FunctionAttributeKey.RGB: |
| | | case FunctionAttributeKey.Angle: |
| | | //case FunctionAttributeKey.FadeTime: |
| | | if (attr.curValue.ToString() == "{}") |
| | | { |
| | |
| | | /// </summary> |
| | | public const string Percent = "percent"; |
| | | /// <summary> |
| | | /// 角度 |
| | | /// </summary> |
| | | public const string Angle = "angle"; |
| | | /// <summary> |
| | | /// 室内温度 |
| | | /// </summary> |
| | | public const string RoomTemp = "room_temp"; |
| | | /// <summary> |
| | | /// 室内湿度 |
| | | /// </summary> |
| | | public const string RoomHumidity = "room_humidity"; |
| | | /// <summary> |
| | | /// 露点温度 |
| | | /// </summary> |
| | | public const string dew_point_temp = "dew_point_temp"; |
| | | /// <summary> |
| | | /// 表面温度 |
| | | /// </summary> |
| | | public const string surface_temp = "surface_temp"; |
| | | /// <summary> |
| | | /// 室内湿度补偿值 |
| | | /// </summary> |
| | | public const string room_humidity_cc = "room_humidity_cc"; |
| | | /// <summary> |
| | | /// 室内温度补偿值 |
| | | /// </summary> |
| | | public const string room_temp_cc = "room_temp_cc"; |
| | | /// <summary> |
| | | /// 毛细阀门 |
| | | /// </summary> |
| | | public const string cac_valve = "cac_valve"; |
| | | /// <summary> |
| | | /// 地暖阀门 |
| | | /// </summary> |
| | | public const string fh_valve = "fh_valve"; |
| | | |
| | | /// <summary> |
| | | /// value |
| | | /// </summary> |
| | |
| | | /// 打开等级(风扇) |
| | | /// </summary> |
| | | public const string OpenLevel = "openLevel"; |
| | | public const string fan_speed_percent = "fan_speed_percent"; |
| | | /// <summary> |
| | | /// 红外按键 |
| | | /// </summary> |
| | |
| | | public static class SPK |
| | | { |
| | | /// <summary> |
| | | /// 通用开关 |
| | | /// </summary> |
| | | public const string OtherCommon = "other.common"; |
| | | |
| | | /// <summary> |
| | | /// 空调科技系统(绿建) |
| | | /// 总控 |
| | | /// </summary> |
| | | public const string AcstParent = "acst.parent"; |
| | | /// <summary> |
| | | /// 空调科技系统(绿建) |
| | | /// 子控 |
| | | /// </summary> |
| | | public const string AcstSub = "acst.sub"; |
| | | |
| | | /// <summary> |
| | | /// 门锁 |
| | | /// </summary> |
| | | public const string DoorLock = "security.door"; |
| | |
| | | list.Add(DoorLock); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | #region 灯光 |
| | |
| | | |
| | | #region 能源 |
| | | /// <summary> |
| | | /// 逆变器 |
| | | /// </summary> |
| | | public const string Inverter = "energy.inverter"; |
| | | /// <summary> |
| | | /// 能源模块 |
| | | /// </summary> |
| | | public const string EnergyStandard = "energy.standard"; |
| | |
| | | var spkList = new List<string>(); |
| | | //spkList.Add(SensorLight); |
| | | spkList.Add(SensorPir); |
| | | spkList.Add(SensorHelp); |
| | | spkList.Add(SensorDoorWindow); |
| | | spkList.Add(SensorSmoke); |
| | | spkList.Add(SensorWater); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 可视对讲 |
| | | /// <summary> |
| | | /// HDL可视对讲 |
| | | /// </summary> |
| | | public const string doorgate="door.gate"; |
| | | #endregion |
| | | |
| | | #region 第三方spk列表 |
| | | /// <summary> |
| | | /// 获取所有第三方品牌功能的spk |
| | |
| | | /// </summary> |
| | | public string desc = string.Empty; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 扩展信息设置 |
| | | /// </summary> |
| | | public class ExtSet |
| | | { |
| | | /// <summary> |
| | | /// 是否开启实验室模式 |
| | | /// </summary> |
| | | public bool labModel = false; |
| | | } |
| | | } |