| | |
| | | |
| | | #endregion |
| | | |
| | | #region 音箱语言控制相关___________________________ |
| | | /// <summary> |
| | | /// 获取已授权的音箱列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetSpeakerList () |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson (new GetSpeakerObj { |
| | | homeId = UserConfig.Instance.CurrentRegion.Id, |
| | | }); |
| | | return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_Speaker_List_Get, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑音箱授权备注 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdateSpeakerRemark (UpdateSpeakerRemarkObj remarkObj) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson (remarkObj); |
| | | return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_Speaker_Remark_Update, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取音箱分配的设备和场景列表 |
| | | /// </summary> |
| | | /// <param name="getType">0 是查询全部 1是查询设备 2是查询场景</param> |
| | | /// <param name="tokenId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetSpeakerDeviceList (int getType, string tokenId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object> (); |
| | | d.Add ("homeId", UserConfig.Instance.CurrentRegion.Id); |
| | | d.Add ("tokenId", tokenId); |
| | | if(getType > 0) { |
| | | d.Add ("isDevice", getType == 1); |
| | | } |
| | | var requestJson = HttpUtil.GetSignRequestJson (d); |
| | | return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_Speaker_DeviceList_Get, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新音箱控制的设备和场景目标 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdateSpeakerDeviceList (UpdateSpeakerDeviceListObj updateSpeakerDeviceListObj) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson (updateSpeakerDeviceListObj); |
| | | return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_Speaker_DeviceList_Update, requestJson); |
| | | } |
| | | #endregion |
| | | |
| | | //#region Kaede --设备功能—————————————————————————————————— |
| | | ///// <summary> |
| | |
| | | //#endregion |
| | | |
| | | //#region Kaede --场景功能-------------------------- |
| | | ///// <summary> |
| | | ///// 获取场景列表 |
| | | ///// 房间ID可空,默认查询住宅下所有房间 |
| | | ///// </summary> |
| | | ///// <param name="roomId">房间ID</param> |
| | | ///// <returns></returns> |
| | | //public ResponsePackNew GetSceneList(string roomId = null) |
| | | //{ |
| | | // Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | // d.Add("homeId", UserConfig.Instance.CurrentRegion.RegionID); |
| | | // if (roomId != null) |
| | | // { |
| | | // d.Add("roomId", roomId); |
| | | // } |
| | | /// <summary> |
| | | /// 获取场景列表 |
| | | /// 房间ID可空,默认查询住宅下所有房间 |
| | | /// </summary> |
| | | /// <param name="roomId">房间ID</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetSceneList (string roomId = null) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object> (); |
| | | d.Add ("homeId", UserConfig.Instance.CurrentRegion.Id); |
| | | if (roomId != null) { |
| | | d.Add ("roomId", roomId); |
| | | } |
| | | |
| | | // var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | // return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneList, requestJson); |
| | | //} |
| | | var requestJson = HttpUtil.GetSignRequestJson (d); |
| | | return HttpUtil.RequestHttpsPostFroHome (NewAPI.Api_Post_GetSecneList, requestJson); |
| | | } |
| | | ///// <summary> |
| | | ///// 获取场景详情 |
| | | ///// </summary> |
| | |
| | | /// <summary> |
| | | /// 添加场景 |
| | | /// </summary> |
| | | /// <param name="sceneList"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew AddScene (List<HDLLinkScene> sceneList) |
| | | { |
| | |
| | | |
| | | return pack; |
| | | } |
| | | ///// <summary> |
| | | ///// 编辑场景 |
| | | ///// </summary> |
| | | ///// <param name="scene"></param> |
| | | ///// <returns></returns> |
| | | //public ResponsePackNew EditScene(Scene scene) |
| | | //{ |
| | | // Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | // d.Add("homeId", UserConfig.Instance.CurrentRegion.RegionID); |
| | | // d.Add("scenes", new List<Scene>() { scene }); |
| | | |
| | | // var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | // return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditSecne, requestJson); |
| | | //} |
| | | /// <summary> |
| | | /// 更新场景 |
| | | /// </summary> |
| | | /// <param name="sceneList"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditScene (List<HDLLinkScene> sceneList) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object> (); |
| | | d.Add ("homeId", UserConfig.Instance.CurrentRegion.Id); |
| | | d.Add ("scenes", sceneList); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson (d); |
| | | return HttpUtil.RequestHttpsPostFroHome (NewAPI.Api_Post_EditSecne, requestJson); |
| | | } |
| | | ///// <summary> |
| | | ///// 删除场景 |
| | | ///// </summary> |