| | |
| | | /// <summary> |
| | | /// 设置属性状态 |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <param name="value"></param> |
| | | /// <param name="setKey"></param> |
| | | /// <param name="setValues"></param> |
| | | /// <returns>修改结果</returns> |
| | | public bool SetAttrState(string key, object value) |
| | | public bool SetAttrState(string setKey, object setValues) |
| | | { |
| | | var attr = attributes.Find((s) => s.key == key); |
| | | var attr = attributes.Find((s) => s.key == setKey); |
| | | if (attr == null) |
| | | { |
| | | switch (setKey) |
| | | { |
| | | case FunctionAttributeKey.CoolTemperatrue: |
| | | case FunctionAttributeKey.HeatTemperatrue: |
| | | case FunctionAttributeKey.AutoTemperatrue: |
| | | case FunctionAttributeKey.DehumiTemperatrue: |
| | | attributes.Add(new FunctionAttributes() |
| | | { |
| | | key = setKey, |
| | | state = setValues.ToString(), |
| | | curValue = setValues.ToString(), |
| | | }); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | attr.state = value.ToString(); |
| | | attr.curValue = value.ToString(); |
| | | attr.state = setValues.ToString(); |
| | | attr.curValue = setValues.ToString(); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | string iconPath = spk.Replace(".", ""); |
| | | switch (spk) |
| | | { |
| | | case SPK.SensorDryContact2: |
| | | case SPK.OtherCommon: |
| | | iconPath = "sensordryContact"; |
| | | break; |
| | | //case SPK.SensorLight: |
| | | // iconPath = "lightswitch"; |
| | | // break; |
| | | case SPK.AirSwitchP3: |
| | | iconPath = "electricalbreaker"; |
| | | break; |
| | |
| | | case SPK.HvacAirFreshJinmao: |
| | | iconPath = "airFreshjinmao"; |
| | | break; |
| | | case SPK.HvacAC: |
| | | case SPK.HvacAC:case SPK.HvacAcPanel: |
| | | iconPath = "acstandard"; |
| | | break; |
| | | case SPK.HvacFan: |
| | | iconPath = "electricalfan"; |
| | | break; |
| | | case SPK.HvacFloorHeat: |
| | | case SPK.HvacFloorHeat:case SPK.HvacFloorHeatPanel: |
| | | iconPath = "floorHeatstandard"; |
| | | break; |
| | | case SPK.ElectricTuyaFan2: |
| | |
| | | /// 设备spk |
| | | /// </summary> |
| | | public string spk = ""; |
| | | /// <summary> |
| | | /// 扩展信息 |
| | | /// 字符串 |
| | | /// </summary> |
| | | public string extend = ""; |
| | | |
| | | private string _SpkCategory = string.Empty; |
| | | /// <summary> |
| | |
| | | public bool online { |
| | | get |
| | | { |
| | | if (spk == SPK.AirSwitchP3) |
| | | if (spk == SPK.AirSwitchP3|| spk == SPK.ElectricalTvHisense) |
| | | { |
| | | return _online; |
| | | } |
| | |
| | | result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code; |
| | | } |
| | | } |
| | | //提示错误 |
| | | if (result != StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | if (!Common.ApiUtlis.Ins.hadInternet) |
| | | { |
| | | collect = !collect; |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result); |
| | | }); |
| | | } else |
| | | this.SaveFunctionFile(); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | collect = !collect; |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.SaveFunctionFile(); |
| | | UI.HomePage.RefreshFunctionView(); |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | |
| | | /// </summary> |
| | | public static class FunctionAttributeKey |
| | | { |
| | | #region 空调bus属性 |
| | | /// <summary> |
| | | /// 制冷模式温度 |
| | | /// </summary> |
| | | public const string CoolTemperatrue = "CoolTemperatrue"; |
| | | /// <summary> |
| | | /// 制热模式温度 |
| | | /// </summary> |
| | | public const string HeatTemperatrue = "HeatTemperatrue"; |
| | | /// <summary> |
| | | /// 自动模式温度 |
| | | /// </summary> |
| | | public const string AutoTemperatrue = "AutoTemperatrue"; |
| | | /// <summary> |
| | | /// 除湿模式温度 |
| | | /// </summary> |
| | | public const string DehumiTemperatrue = "DehumiTemperatrue"; |
| | | #endregion |
| | | |
| | | #region 空调bus属性 |
| | | /// <summary> |
| | | /// [4]普通:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string NormalTemperatrue = "NormalTemperatrue"; |
| | | /// <summary> |
| | | /// [5]白天:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string DayTemperatrue = "DayTemperatrue"; |
| | | /// <summary> |
| | | /// [6]夜晚:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string NightTemperatrue = "NightTemperatrue"; |
| | | /// <summary> |
| | | /// [7]离开:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string AwayTemperatrue = "AwayTemperatrue"; |
| | | #region 三相空开属性 |
| | | |
| | | |
| | | /// <summary> |
| | | /// A相功率 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string ElectricityC = "electricity_c"; |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | |
| | | public const string Temperature = "temperature"; |
| | | public const string Hcho = "hcho"; |
| | | public const string Humidity = "humidity"; |
| | | /// <summary> |
| | | /// 照度 |
| | | /// </summary> |
| | | public const string Illuminance = "illuminance"; |
| | | public const string Pm25 = "pm25"; |
| | | public const string Pm10 = "pm10"; |
| | | public const string Tvoc = "tvoc"; |
| | | /// <summary> |
| | | /// 状态,传感器 |
| | |
| | | public static class SPK |
| | | { |
| | | /// <summary> |
| | | /// 未知SPK |
| | | /// (自定义) |
| | | /// </summary> |
| | | public const string NULL = "NULL"; |
| | | /// <summary> |
| | | /// 西墨可视对讲门口机 |
| | | /// (自定义) |
| | | /// </summary> |
| | | public const string LinphoneXiMo = "door.gate"; |
| | | /// <summary> |
| | | /// 群控(自定义) |
| | | /// </summary> |
| | | public const string GroupControl = "groupControl"; |
| | |
| | | /// 子控 |
| | | /// </summary> |
| | | public const string AcstSub = "acst.sub"; |
| | | /// <summary> |
| | | /// 热水器 |
| | | /// 金茂 |
| | | /// </summary> |
| | | public const string WaterHeaterJinmao = "electrical.water_heater.jinmao"; |
| | | /// <summary> |
| | | /// 逆变器/新能源 |
| | | /// 金茂 |
| | | /// </summary> |
| | | public const string InverterJinmao = "energy.inverter.jinmao"; |
| | | |
| | | /// <summary> |
| | | /// 门锁 |
| | |
| | | /// </summary> |
| | | public const string HvacAC = "hvac.ac"; |
| | | /// <summary> |
| | | /// 面板空调 |
| | | /// </summary> |
| | | public const string HvacAcPanel = "hvac.ac_panel"; |
| | | /// <summary> |
| | | /// 毛细管空调 |
| | | /// </summaryc |
| | | public const string HvacCac = "hvac.cac"; |
| | |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AcStandard); |
| | | spkList.Add(HvacAC); |
| | | spkList.Add(HvacAcPanel); |
| | | spkList.Add(AcIr); |
| | | spkList.Add(HvacCac); |
| | | return spkList; |
| | |
| | | /// 地暖 |
| | | /// </summary> |
| | | public const string HvacFloorHeat = "hvac.floorHeat"; |
| | | /// <summary> |
| | | /// 面板地暖 |
| | | /// </summary> |
| | | public const string HvacFloorHeatPanel = "hvac.floorHeat_panel"; |
| | | |
| | | /// <summary> |
| | | /// 地热spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(FloorHeatStandard); |
| | | spkList.Add(HvacFloorHeat); |
| | | spkList.Add(HvacFloorHeat); spkList.Add(HvacFloorHeatPanel); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 红外热水器 |
| | | /// </summary> |
| | | public const string HeaterIr = " ir.water_heater"; |
| | | public const string HeaterIr = "ir.water_heater"; |
| | | /// <summary> |
| | | /// 红外风扇 |
| | | /// </summary> |