| | |
| | | { |
| | | var attrs = new List<string>(); |
| | | |
| | | foreach(var attr in attributes) |
| | | foreach (var attr in attributes) |
| | | { |
| | | attrs.Add(attr.key); |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public string GetAttrState(string key) |
| | | { |
| | | //一级查询keyValue值 |
| | | var attrState = attributes.Find((s) => s.key == key.ToString()); |
| | | if (attrState == null) |
| | | { |
| | |
| | | } |
| | | if (string.IsNullOrEmpty(attrState.state)) |
| | | { |
| | | //二级查询keyValue值 |
| | | return GetOriginalState(key); |
| | | } |
| | | return attrState.state; |
| | |
| | | |
| | | /// <summary> |
| | | /// 获取初始状态 |
| | | /// 默认值:0 |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <param name="key">语雀定义的属性值</param> |
| | | /// <returns></returns> |
| | | public string GetOriginalState(string key) |
| | | { |
| | |
| | | public List<string> roomIds = new List<string>(); |
| | | |
| | | /// <summary> |
| | | /// 存储属性配置 |
| | | /// 环境传感器的等级 |
| | | /// </summary> |
| | | public List<AttrKeyConfig> attrKeyConfigs = new List<AttrKeyConfig>(); |
| | | |
| | | public List<AttrKeyConfig> GetAttrKeyConfigs(string key) |
| | | { |
| | | if (attrKeyConfigs.Count == 0) |
| | | { |
| | | switch (key) |
| | | { |
| | | case "pm2.5": |
| | | |
| | | break; |
| | | } |
| | | } |
| | | return attrKeyConfigs; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// bus协议数据格式 |
| | | /// 使用A协议控制时,改属性为空 |
| | | /// </summary> |
| | |
| | | /// 是否在线 |
| | | /// </summary> |
| | | public bool online = true; |
| | | |
| | | /// <summary> |
| | | /// 环境面板 绑定的 设备目标sid列表 |
| | | /// </summary> |
| | | public List<string> targetSids = new List<string>(); |
| | | /// <summary> |
| | | /// 云端数据创建的时间 |
| | | /// </summary> |
| | |
| | | _trait_on_off.curValue = "off"; |
| | | } |
| | | } |
| | | if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop") |
| | | if (_trait_on_off.curValue.ToString() != "on" && _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop") |
| | | { |
| | | _trait_on_off.curValue = "off"; |
| | | } |
| | |
| | | collect = !collect; |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result); |
| | | }); |
| | | }else |
| | | } else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.UnbindDeviceToRoom(deviceId,roomId); |
| | | result = ApiUtlis.Ins.HttpRequest.UnbindDeviceToRoom(deviceId, roomId); |
| | | } |
| | | //提示错误 |
| | | if (result != StateCode.SUCCESS) |
| | |
| | | { |
| | | roomNameList += ","; |
| | | } |
| | | roomNameList += findRoom.floorName +"-"+ findRoom.roomName; |
| | | roomNameList += findRoom.floorName + "-" + findRoom.roomName; |
| | | } |
| | | if (roomNameList == "" ) |
| | | if (roomNameList == "") |
| | | { |
| | | roomNameList = Language.StringByID(StringId.WholeZone); |
| | | } |
| | |
| | | case FunctionAttributeKey.Percent: |
| | | case FunctionAttributeKey.CCT: |
| | | case FunctionAttributeKey.RGB: |
| | | //case FunctionAttributeKey.FadeTime: |
| | | //case FunctionAttributeKey.FadeTime: |
| | | if (attr.curValue.ToString() == "{}") |
| | | { |
| | | if (attr.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | attr.curValue = "off"; |
| | | } |
| | | else if (attr.key == FunctionAttributeKey.Mode ) |
| | | else if (attr.key == FunctionAttributeKey.Mode) |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | else |
| | | else |
| | | { |
| | | attr.curValue = "0"; |
| | | } |
| | |
| | | return sendDataObj; |
| | | } |
| | | |
| | | public AlinkDoorlockObj GetGatewayAlinkDoorlockData(string userId,string extStr) |
| | | public AlinkDoorlockObj GetGatewayAlinkDoorlockData(string userId, string extStr) |
| | | { |
| | | var sendDataObj = new AlinkDoorlockObj(); |
| | | sendDataObj.id = Control.Ins.msg_id.ToString(); |
| | |
| | | try |
| | | { |
| | | return Convert.ToByte(loopId, 16); |
| | | }catch |
| | | } catch |
| | | { |
| | | return 0; |
| | | } |
| | |
| | | /// <summary> |
| | | /// (红外空调) |
| | | /// </summary> |
| | | public const string AcIr= "ir.ac"; |
| | | public const string AcIr = "ir.ac"; |
| | | /// <summary> |
| | | /// 空调 |
| | | /// </summary> |
| | | public const string HvacAC = "hvac.ac"; |
| | | /// <summary> |
| | | /// 毛细管空调 |
| | | /// </summary> |
| | | public const string HvacCac = "hvac.cac"; |
| | | |
| | | /// <summary> |
| | | /// 空调spk列表 |
| | |
| | | spkList.Add(AcStandard); |
| | | spkList.Add(HvacAC); |
| | | spkList.Add(AcIr); |
| | | spkList.Add(HvacCac); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | public const string SenesorMegahealth = "sensor.megahealth"; |
| | | public const string SenesorMegahealth2 = "sensor.megahealth.zg"; |
| | | /// <summary> |
| | | /// 紧急呼叫 |
| | | /// </summary> |
| | | public const string SensorHelp = "sensor.help"; |
| | | /// <summary> |
| | | /// 安防传感器spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | public const string PanelEnvironment = "screen.panel"; |
| | | /// <summary> |
| | | /// 面板spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> PanelSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorHelp); |
| | | spkList.Add(PanelEnvironment); |
| | | return spkList; |
| | | } |
| | | |
| | | #region 环境传感器 |
| | | /// <summary> |
| | |
| | | //} |
| | | |
| | | |
| | | public class VersionInfo |
| | | { |
| | | public string module = ""; |
| | | public string version = ""; |
| | | } |
| | | public class VersionInfo |
| | | { |
| | | public string module = ""; |
| | | public string version = ""; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 功能属性相关配置信息 |
| | | /// 环境传感器等级使用 |
| | | /// </summary> |
| | | public class AttrKeyConfig |
| | | { |
| | | public string key = string.Empty; |
| | | /// <summary> |
| | | /// 配置类型 |
| | | /// interval 区间 |
| | | /// 目前只支持:interval |
| | | /// </summary> |
| | | public string type = string.Empty; |
| | | |
| | | public string unit = string.Empty; |
| | | |
| | | public List<AttrKeyInfo> configs = new List<AttrKeyInfo>(); |
| | | |
| | | } |
| | | |
| | | public class AttrKeyInfo |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string start = string.Empty; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string end = string.Empty; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string color = string.Empty; |
| | | /// <summary> |
| | | /// 描述 |
| | | /// </summary> |
| | | public string desc = string.Empty; |
| | | } |
| | | } |