| | |
| | | public Function() |
| | | { |
| | | } |
| | | |
| | | |
| | | |
| | | #region base info |
| | | /// <summary> |
| | |
| | | /// 产品时间戳:4bytes 以2020年1月1日算出的时间戳0.1s为单位
|
| | | /// 产品类别:01 调光器、02 继电器、03 干接点模块、04 传感器、05 面板
|
| | | /// 物模型类型:
|
| | | /// 01 开关类:01 开关、02 插座、03 |
| | | /// 02 照明: 01 开关、02 调光、03 色温、04 LED
|
| | | /// 01 开关类:01 开关、02 插座、03 |
| | | /// 02 照明: 01 开关、02 调光、03 色温、04 LED
|
| | | /// 03 遮阳: 01 窗帘电机、02 百叶窗、03 开合帘、04 卷帘
|
| | | /// 04 恒温器:01 空调、02 地暖、03 毛细空调 |
| | | /// 04 恒温器:01 空调、02 地暖、03 毛细空调 |
| | | /// 05 新风 |
| | | /// 06 影音 |
| | | /// 07 音乐 |
| | |
| | | /// 是否收藏 |
| | | /// </summary> |
| | | public bool collect = false; |
| | | /// <summary> |
| | | /// 是否在线 |
| | | /// </summary> |
| | | public bool online = true; |
| | | /// <summary> |
| | | /// 云端数据创建的时间 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public int fixedSerialNumber = int.MaxValue; |
| | | |
| | | public string GetBusId () |
| | | public string GetBusId() |
| | | { |
| | | string busId = ""; |
| | | if (bus_Data != null) |
| | |
| | | public string GetRoomListName() |
| | | { |
| | | string roomNameList = ""; |
| | | foreach(var roomId in roomIds) |
| | | foreach (var roomId in roomIds) |
| | | { |
| | | var findRoom = DB_ResidenceData.residenceData.Rooms.Find(obj => obj.uid == roomId); |
| | | if (findRoom == null) |
| | |
| | | public void SaveFunctionData() |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | FileUtils.WriteFileByBytes( savePath, ssd); |
| | | FileUtils.WriteFileByBytes(savePath, ssd); |
| | | MainPage.Log($"Save FunctionData {this.functionType} : {this.sid}"); |
| | | } |
| | | |
| | |
| | | var acd = new AlinkControlData(); |
| | | acd.sid = sid; |
| | | var aca = new AlinkControlAttributes(); |
| | | foreach(var dic in commandDictionary) |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | aca.key = dic.Key; |
| | | aca.value = dic.Value; |
| | |
| | | /// 获取Api控制数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ApiAlinkControlActionObj GetApiControlData(Dictionary<string,string> keyValues) |
| | | public ApiAlinkControlActionObj GetApiControlData(Dictionary<string, string> keyValues) |
| | | { |
| | | ApiAlinkControlActionObj aaao = new ApiAlinkControlActionObj(); |
| | | aaao.deviceId = this.deviceId; |
| | |
| | | public string spk = ""; |
| | | |
| | | public List<AlinkControlAttributes> attributes = new List<AlinkControlAttributes>(); |
| | | //[Newtonsoft.Json.JsonIgnore] |
| | | public BusData bus = new BusData(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | public string time_stamp = ""; |
| | | public string id = ""; |
| | | } |
| | | /// <summary> |
| | | /// 本地状态读取 |
| | | /// A协议状态读取格式对象 |
| | | /// </summary> |
| | | public class GatewayAlinkReadObj |
| | | { |
| | | public string id = "0"; |
| | | public List<Dictionary<string, string>> objects = new List<Dictionary<string, string>>(); |
| | | public string time_stamp = ""; |
| | | } |
| | | /// <summary> |
| | | /// A协议控制数据 |
| | |
| | | public class BusData |
| | | { |
| | | public string addresses = "FFFF"; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public byte SubnetID |
| | | { |
| | | get |
| | |
| | | return Convert.ToByte(addresses.Substring(0, 2), 16); |
| | | } |
| | | } |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public byte DeviceID |
| | | { |
| | | get |