wxr
2024-05-07 f16fd06aa226e9f97a27858624d4ea7cf8975d25
HDL_ON/Entity/Function/Function.cs
@@ -76,7 +76,8 @@
                DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // 当地时区
                return startTime.AddMilliseconds(Convert.ToDouble(time_stamp)).ToString("s");
            }
            catch {
            catch
            {
                return DateTime.MinValue.ToString("s");
            }
        }
@@ -455,10 +456,11 @@
        public bool collect = false;
        private bool _online;
        public bool online {
        public bool online
        {
            get
            {
                if (spk == SPK.AirSwitchP3|| spk == SPK.ElectricalTvHisense)
                if (spk == SPK.AirSwitchP3 || spk == SPK.ElectricalTvHisense)
                {
                    return _online;
                }
@@ -556,7 +558,7 @@
                    }
                    break;
            }
            return text;
        }
@@ -642,7 +644,8 @@
            new System.Threading.Thread(() =>
            {
                if (spk == SPK.GroupControl) {
                if (spk == SPK.GroupControl)
                {
                    var groupControl = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
                    if (collect)
                    {
@@ -672,7 +675,8 @@
                        collect = !collect;
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    });
                } else
                }
                else
                {
                    Application.RunOnMainThread(() =>
                    {
@@ -773,7 +777,7 @@
        /// </summary>
        public async void UpdataRoomIds()
        {
            new System.Threading.Thread( () =>
            new System.Threading.Thread(() =>
            {
                var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(this);
                //直接保存本地,
@@ -913,12 +917,12 @@
            foreach (var attr in list)
            {
                if(attr.key == FunctionAttributeKey.ColorfulBegin || attr.key == FunctionAttributeKey.ColorfulEnd || attr.key == FunctionAttributeKey.ColorfulTime)
                if (attr.key == FunctionAttributeKey.ColorfulBegin || attr.key == FunctionAttributeKey.ColorfulEnd || attr.key == FunctionAttributeKey.ColorfulTime)
                {
                    continue;
                }
                //窗帘同时发送开关跟百分比会有问题,
                if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
                if (spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
                {
                    if (attr.key == FunctionAttributeKey.OnOff)
                    {
@@ -927,7 +931,8 @@
                            continue;
                        }
                    }
                }else if (spk == SPK.GroupControl)
                }
                else if (spk == SPK.GroupControl)
                {
                    sFunc.type = "5";
                }
@@ -1029,7 +1034,7 @@
                                    }
                                }
                            }
                            else if(attr.key == "security")
                            else if (attr.key == "security")
                            {
                                attr.curValue = "false";
                            }
@@ -1046,15 +1051,25 @@
                            {
                                vv = 26;
                            }
                            sFunc.status.Add(new SceneFunctionStatus() {
                            sFunc.status.Add(new SceneFunctionStatus()
                            {
                                UintString = attr.unit,
                                key = attr.key, value = Convert.ToInt32(vv).ToString(), max = attr.max, min = attr.min }) ;
                                key = attr.key,
                                value = Convert.ToInt32(vv).ToString(),
                                max = attr.max,
                                min = attr.min
                            });
                        }
                        else
                        {
                            sFunc.status.Add(new SceneFunctionStatus() {
                            sFunc.status.Add(new SceneFunctionStatus()
                            {
                                UintString = attr.unit,
                                key = attr.key, value = attr.curValue.ToString(), max = attr.max, min = attr.min });
                                key = attr.key,
                                value = attr.curValue.ToString(),
                                max = attr.max,
                                min = attr.min
                            });
                        }
                        break;
                }
@@ -1272,7 +1287,7 @@
        /// <summary>
        /// 属性单位
        /// </summary>
        public string unit=string.Empty;
        public string unit = string.Empty;
    }
    /// <summary>
@@ -1707,7 +1722,8 @@
                try
                {
                    return Convert.ToByte(loopId, 16);
                } catch
                }
                catch
                {
                    return 0;
                }
@@ -1736,7 +1752,7 @@
        /// <summary>
        /// 大华摄像头
        /// </summary>
        //public const string IpCam_Imou = "security.ipcam.imou";
        public const string IpCam_Imou = "security.ipcam.imou";
        /// <summary>
        /// 机械手
        /// </summary>
@@ -1756,7 +1772,7 @@
        /// 门锁
        /// </summary>
        public const string DoorLock = "security.door";
        /// <summary>
        /// 门锁spk列表
        /// </summary>
@@ -1767,19 +1783,42 @@
            list.Add(DoorLock);
            return list;
        }
        /// <summary>
        /// 猫眼(旧spk)
        /// </summary>
        public const string Peephole = "peephole";
        /// <summary>
        /// 猫眼(新spk 暂时没用)
        /// </summary>
        //public const string PeepholeEz = "security.peephole.ez";
        /// <summary>
        /// 萤石视频门锁
        /// </summary>
        public const string VideoDoorLock = "security.door.ezviz";
        /// <summary>
        /// 萤石摄像头
        /// </summary>
        public const string Ev_Ipcam = "security.ipcam.ez";
        /// <summary>
        /// 影音中控
        /// </summary>
        public const string AvZkAiks = "av.zk.aiks";
        /// <summary>
        /// 萤石视频门锁spk列表
        /// </summary>
        /// <returns></returns>
        public static List<string> GetVideoDoorLockSPKList()
        {
            var list = new List<string>();
            list.Add(VideoDoorLock);
            return list;
        }
        /// <summary>
        /// 影音中控spk列表
        /// </summary>
@@ -1793,7 +1832,17 @@
            return list;
        }
        /// <summary>
        /// 萤石摄像头spk列表
        /// </summary>
        /// <returns></returns>
        public static List<string> GetEvIpcamSPKList()
        {
            var list = new List<string>();
            list.Add(Ev_Ipcam);
            return list;
        }
        #region 灯光
        /// <summary>
        /// (开关灯)
@@ -1960,6 +2009,14 @@
        #endregion
        #region 能源
        /// <summary>
        /// 逆变器
        /// </summary>
        public const string Inverter = "energy.inverter";
        /// <summary>
        /// 三相逆变器
        /// </summary>
        public const string InverterRst = "energy.inverter_rst";
        /// <summary>
        /// 能源模块
        /// </summary>
@@ -2201,7 +2258,7 @@
            spkList.Add(SensorEnvironment); spkList.Add(SensorEnvironmentHailin);
            spkList.Add(SensorEnvironment2);
            spkList.Add(SensorEnvironment3);
            return spkList;
        }
@@ -2360,7 +2417,7 @@
        /// <summary>
        /// HDL可视对讲
        /// </summary>
        public const string doorgate="door.gate";
        public const string doorgate = "door.gate";
        #endregion
        #region 第三方spk列表