wxr
2022-11-25 a16dbea60b9fd0550dcdefd34c94ff6711af2cbc
HDL_ON/Entity/Function/Function.cs
@@ -109,13 +109,13 @@
        /// </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))
            {
@@ -243,12 +243,39 @@
        /// <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 deviceId = "0";
        /// <summary>
        /// 第三方设备扩展id
        /// </summary>
        public string extDevId = string.Empty;
        /// <summary>
        /// 设备spk
        /// </summary>
@@ -377,16 +404,20 @@
        /// 是否收藏
        /// </summary>
        public bool collect = false;
        private bool _online = false;
        /// <summary>
        /// 是否在线
        /// </summary>
        public bool online {
        public bool online
        {
            get
            {
                return true;
            }
            set {
            set
            {
                _online = value;
            }
        }
@@ -986,6 +1017,7 @@
        /// 颜色
        /// </summary>
        public const string RGB = "rgb";
        public const string RGBW = "rgbw";
        /// <summary>
        /// 渐变时间
        /// </summary>
@@ -1290,6 +1322,29 @@
    public static class SPK
    {
        /// <summary>
        /// 通用开关
        /// </summary>
        public const string OtherCommon = "other.common";
        /// <summary>
        /// 大华摄像头
        /// </summary>
        public const string IpCam_Imou = "security.ipcam.imou";
        /// <summary>
        /// 机械手
        /// </summary>
        public const string MechanicalArm = "electrical.mechanical_arm";
        /// <summary>
        /// 空调科技系统(绿建)
        /// 总控
        /// </summary>
        public const string AcstParent = "acst.parent";
        /// <summary>
        /// 空调科技系统(绿建)
        /// 子控
        /// </summary>
        public const string AcstSub = "acst.sub";
        /// <summary>
        /// 门锁
        /// </summary>
        public const string DoorLock = "security.door";
@@ -1303,6 +1358,7 @@
            list.Add(DoorLock);
            return list;
        }
        #region 灯光
@@ -1472,6 +1528,10 @@
        #region 能源
        /// <summary>
        /// 逆变器
        /// </summary>
        public const string Inverter = "energy.inverter";
        /// <summary>
        /// 能源模块
        /// </summary>
        public const string EnergyStandard = "energy.standard";
@@ -1565,6 +1625,10 @@
        public const string SenesorMegahealth = "sensor.megahealth";
        public const string SenesorMegahealth2 = "sensor.megahealth.zg";
        /// <summary>
        /// 毫米波传感器(姿态版)
        /// </summary>
        public const string SensorMmvPose = "sensor.mmv_pose";
        /// <summary>
        /// 紧急呼叫
        /// </summary>
        public const string SensorHelp = "sensor.help";
@@ -1577,6 +1641,7 @@
            var spkList = new List<string>();
            //spkList.Add(SensorLight);
            spkList.Add(SensorPir);
            spkList.Add(SensorHelp);
            spkList.Add(SensorDoorWindow);
            spkList.Add(SensorSmoke);
            spkList.Add(SensorWater);
@@ -1588,6 +1653,7 @@
            spkList.Add(SensorDryContact2);
            spkList.Add(SenesorMegahealth);
            spkList.Add(SenesorMegahealth2);
            spkList.Add(SensorMmvPose);
            return spkList;
        }
        #endregion
@@ -1836,6 +1902,13 @@
        }
        #endregion
        #region 可视对讲
        /// <summary>
        /// HDL可视对讲
        /// </summary>
        public const string doorgate="door.gate";
        #endregion
        #region 第三方spk列表
        /// <summary>
        /// 获取所有第三方品牌功能的spk
@@ -1852,6 +1925,7 @@
            spkList.Add(ElectricTuyaWaterValve2);
            spkList.Add(ElectricTuyaWeepRobot);
            spkList.Add(ElectricTuyaWeepRobot2);
            spkList.Add(SensorMmvPose);
            spkList.Add(SenesorMegahealth);
            spkList.Add(SenesorMegahealth2);
            return spkList;
@@ -1877,7 +1951,7 @@
                    list.Add(ElectricTuyaWeepRobot2);
                    break;
                case BrandType.All3tyBrand:
                    list.Add(SenesorMegahealth);//兆观
                    list.Add(SenesorMegahealth2);//兆观
                    break;
            }
            return list;