| | |
| | | return RequestHttps($"{severAddress}/App/EditHome", jsonString, false); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取住宅下的成员账号 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePack GetResidenceMemberAccount() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("DistributedMark", DB_ResidenceData.residenceData.residecenInfo.RegionID); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/GetSubAccountByDistributedMark", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改子账号昵称 |
| | | /// </summary> |
| | | /// <param name="nickName"></param> |
| | | /// <param name="subAccountGuid"></param> |
| | | /// <returns></returns> |
| | | public ResponsePack EditSubAccountNickName(string nickName,string subAccountGuid) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("SubAccountGuid", subAccountGuid); |
| | | d.Add("NickName", nickName); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/EditSubAccountNickName", jsonString, true); |
| | | } |
| | | /// <summary> |
| | | /// 修改子账号创建场景权限 |
| | | /// </summary> |
| | | /// <param name="nickName"></param> |
| | | /// <param name="subAccountGuid"></param> |
| | | /// <returns></returns> |
| | | public ResponsePack ChangeCreateSceneState(string homeGuid, string subAccountGuid) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("SubAccountGuid", subAccountGuid); |
| | | d.Add("HomeGuid", homeGuid); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/ChangeCreateSceneState", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取住宅下子账号的共享数据列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePack GetShareDataByMemberAccount(string memberId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("DistributedMark", memberId); |
| | | d.Add("HouseDistributedMark", DB_ResidenceData.residenceData.residecenInfo.RegionID); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeDataShare/GetShareDataBySubAccount", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取住宅下子账号的共享数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePack GetShareData(string memberId,string hId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("DistributedMark", memberId); |
| | | d.Add("HouseDistributedMark", hId); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeDataShare/GetOneShareData", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 增加共享数据列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePack AddShareData(ShareData shareData) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("ShareName", shareData.ShareName); |
| | | d.Add("HouseDistributedMark", shareData.HouseDistributedMark); |
| | | d.Add("ShareDataBytes", shareData.ShareDataBytes); |
| | | d.Add("SubAccountDistributedMark", shareData.SubAccountDistributedMark); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeDataShare/AddShareData", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 增加共享数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePack EditShareData(ShareData shareData) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("DistributedMark", shareData.DistributedMark); |
| | | d.Add("ShareName", shareData.ShareName); |
| | | d.Add("HouseDistributedMark", shareData.HouseDistributedMark); |
| | | d.Add("ShareDataBytes", shareData.ShareDataBytes); |
| | | d.Add("SubAccountDistributedMark", shareData.SubAccountDistributedMark); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeDataShare/EditShareData", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定子账号到住宅下 |
| | | /// </summary> |
| | | /// <param name="subAccount"></param> |
| | | /// <param name="nickName"></param> |
| | | /// <returns></returns> |
| | | public ResponsePack BindResidenceMemberAccount(string subAccount,string nickName) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("SubAccount", subAccount); |
| | | d.Add("HouseDistributedMark", DB_ResidenceData.residenceData.residecenInfo.RegionID); |
| | | d.Add("Nickname", nickName); |
| | | d.Add("IsAllowRemoteCtrl", true); |
| | | |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/BindSubAccount", jsonString, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取住宅下的成员账号 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePack GetResidenceMemberAccountInfo(string account) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("Account", account); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return RequestHttps($"{severAddress}/ZigbeeUsers/GetSubAccountInfo", jsonString, true); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | { |
| | | sid = "000101" + guid + "0102010001AABB", |
| | | name = ss.GetValue("Name").ToString(), |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="on_off", max=100,min = 0, value= new List<string> { "on","off"} }, |
| | | }, |
| | | roomIdList = roomIds, |
| | |
| | | { |
| | | sid = "000101" + guid + "0202020001AABB", |
| | | name = ss.GetValue("Name").ToString(), |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="brightness", max=100,min = 0, value= new List<string> { "up","down"} }, |
| | | }, |
| | | roomIdList = roomIds, |
| | |
| | | { |
| | | sid = "000101" + guid + "0202040001AABB", |
| | | name = ss.GetValue("Name").ToString(), |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="brightness", max=100,min = 0, value= new List<string> { "on","off"} }, |
| | | new Trait { attri="color", max=100,min = 0, value= new List<string> { "255", "255", "255" } }, |
| | | }, |
| | |
| | | { |
| | | sid = "000101" + guid + "0204010001AABB", |
| | | name = ss.GetValue("Name").ToString(), |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="on_off", max=1,min = 0, value= new List<string> { "on","off"} }, |
| | | new Trait { attri="mode", max = 2,min =0,value = new List<string>{ "auto", "heat", "cool","dry" } }, |
| | | new Trait { attri = "fan",max = 3,min =0,value = new List<string>{ "low", "mid", "high" ,"auto"} }, |
| | |
| | | name = ss.GetValue("Name").ToString(), |
| | | roomIdList = roomIds, |
| | | //roomIdList = new List<string>() { roomSid }, |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="on_off", max=2,min = 0, value= new List<string> { "on","off","stop"} }, |
| | | },// "curtain", |
| | | lastState = "开", |
| | |
| | | name = ss.GetValue("Name").ToString(), |
| | | roomIdList = roomIds, |
| | | //roomIdList = new List<string>() { roomSid }, |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="on_off", max=100,min = 0, value= new List<string> { "on","off","stop"} }, |
| | | },// "rollingshutter", |
| | | lastState = "20%", |
| | |
| | | name = ss.GetValue("Name").ToString(), |
| | | roomIdList = roomIds, |
| | | //roomIdList = new List<string>() { roomSid }, |
| | | propertList = new List<Trait>() { |
| | | function = new List<Trait>() { |
| | | new Trait { attri="on_off", max=100,min = 0, value= new List<string> { "on","off","stop"} }, |
| | | }, |
| | | lastState = "20%", |