| | |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | |
| | | /// 设备spk |
| | | /// </summary> |
| | | public string spk = ""; |
| | | /// <summary> |
| | | /// 功能类别 |
| | | /// 如:空调类、灯光类、窗帘类 |
| | | /// </summary> |
| | | public FunctionCategory functionCategory |
| | | { |
| | | get |
| | | { |
| | | try |
| | | { |
| | | var _functionCategoryString = sid.Substring(16, 2); |
| | | var _functionCategory = Convert.ToInt32(_functionCategoryString, 16); |
| | | return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), _functionCategory); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"get FunctionCategory error : {ex.Message}"); |
| | | return FunctionCategory.UnKown; |
| | | } |
| | | } |
| | | } |
| | | ///// <summary> |
| | | ///// 功能类别 |
| | | ///// 如:空调类、灯光类、窗帘类 |
| | | ///// </summary> |
| | | //public FunctionCategory Spk_Prefix |
| | | //{ |
| | | // get |
| | | // { |
| | | // try |
| | | // { |
| | | // var _functionCategoryString = sid.Substring(16, 2); |
| | | // var _functionCategory = Convert.ToInt32(_functionCategoryString, 16); |
| | | // return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), _functionCategory); |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log($"get FunctionCategory error : {ex.Message}"); |
| | | // return FunctionCategory.UnKown; |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 功能类型 |
| | | ///// </summary> |
| | | public FunctionType functionType |
| | | //public FunctionType spk |
| | | //{ |
| | | // get |
| | | // { |
| | | // var _functionTypeString = sid.Substring(16, 4); |
| | | // return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(_functionTypeString, 16)); |
| | | // } |
| | | //} |
| | | |
| | | string spk_Prefix; |
| | | /// <summary> |
| | | /// spk前缀 |
| | | /// 大类 |
| | | /// 功能类别 |
| | | /// 如:空调类、灯光类、窗帘类 |
| | | /// </summary> |
| | | public string Spk_Prefix |
| | | { |
| | | get |
| | | { |
| | | var _functionTypeString = sid.Substring(16, 4); |
| | | return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(_functionTypeString, 16)); |
| | | |
| | | if (string.IsNullOrEmpty(spk_Prefix)) |
| | | { |
| | | spk_Prefix = spk.Split(".")[0]; |
| | | } |
| | | return spk_Prefix; |
| | | } |
| | | } |
| | | string spk_Suffix; |
| | | ///// <summary> |
| | | ///// spk后缀 |
| | | ///// 小类 |
| | | ///// 功能类型 |
| | | ///// </summary> |
| | | //public string spk |
| | | //{ |
| | | // get |
| | | // { |
| | | // if (string.IsNullOrEmpty(spk_Suffix)) |
| | | // { |
| | | // try |
| | | // { |
| | | // spk_Suffix = spk.Split(".")[1]; |
| | | // } |
| | | // catch |
| | | // { |
| | | // spk_Suffix = ""; |
| | | // } |
| | | // } |
| | | // return spk_Suffix; |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// A协议功能的特性 |
| | |
| | | _trait_on_off.curValue = "off"; |
| | | } |
| | | } |
| | | if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off") |
| | | if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop") |
| | | { |
| | | _trait_on_off.curValue = "off"; |
| | | } |
| | | return _trait_on_off; |
| | | } |
| | | //set |
| | | //{ |
| | | // _trait_on_off = value; |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | roomNameList += findRoom.floorName +"-"+ findRoom.roomName; |
| | | } |
| | | if (roomNameList == "" && functionType == FunctionType.Scene) |
| | | if (roomNameList == "" ) |
| | | { |
| | | roomNameList = Language.StringByID(StringId.WholeZone); |
| | | } |
| | |
| | | /// </summary> |
| | | public void UpdataFuncitonInfo() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.UpdataDevcieInfo(this); |
| | |
| | | /// 湿度传感器 |
| | | /// </summary> |
| | | public const string SensorHumidity = "sensor.humidity"; |
| | | |
| | | /// <summary> |
| | | /// 烟雾传感器 |
| | | /// </summary> |
| | | public const string SensorSmoke = "sensor.smoke"; |
| | | /// <summary> |
| | | /// 水浸传感器 |
| | | /// </summary> |
| | | public const string SensorWater = "sensor.water"; |
| | | /// <summary> |
| | | /// 燃气传感器 |
| | | /// </summary> |
| | | public const string SensorGas= "sensor.gas"; |
| | | /// <summary> |
| | | /// 红外珊栏传感器 |
| | | /// </summary> |
| | | public const string SensorShanLan = "sensor.shanlan"; |
| | | /// <summary> |
| | | /// 红外对射传感器 |
| | | /// </summary> |
| | | public const string SensorDuiShe = "sensor.duishe"; |
| | | /// <summary> |
| | | /// 超声波传感器 |
| | | /// </summary> |
| | | public const string SensoruUtrasonic = "sensor.ultrasonic"; |
| | | |
| | | /// <summary> |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string DryContact = "dryContact.standard"; |
| | | public const string SensorDryContact = "sensor.dryContact"; |
| | | /// <summary> |
| | | /// 家电、插座 |
| | | /// </summary> |
| | |
| | | /// 家电、风扇 |
| | | /// </summary> |
| | | public const string ElectricFan = "electrical.fan"; |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 功能类别 |
| | | /// </summary> |
| | | public static class FunctionCategory |
| | | { |
| | | /// <summary> |
| | | ///(灯) |
| | | /// </summary> |
| | | public const string Light = "light"; |
| | | /// <summary> |
| | | /// (窗帘) |
| | | /// </summary> |
| | | public const string Curtain = "curtain"; |
| | | /// <summary> |
| | | /// (空调) |
| | | /// </summary> |
| | | public const string AC = "ac"; |
| | | /// <summary> |
| | | /// (地热) |
| | | /// </summary> |
| | | public const string FloorHeat = "floorHeat"; |
| | | /// <summary> |
| | | /// (新风) |
| | | /// </summary> |
| | | public const string AirFresh = "airFresh"; |
| | | /// <summary> |
| | | /// (音乐) |
| | | /// </summary> |
| | | public const string Music = "music"; |
| | | /// <summary> |
| | | /// (传感器) |
| | | /// </summary> |
| | | public const string Sensor = "sensor"; |
| | | /// <summary> |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string DryContact = "dryContact"; |
| | | /// <summary> |
| | | /// 家电 |
| | | /// </summary> |
| | | public const string Electric = "electrical"; |
| | | |
| | | //Music = 0x09, |
| | | } |
| | | |
| | | |
| | | } |