/// <summary> /// Update the profile of a heating group. /// Possible event bus notifications: GROUP_CHANGED /// Solution = INDOOR_CLIMATE /// </summary> /// <param name="groupId">The identifier of the heating group of which the profile should be updated.</param> /// <param name="profileIndex">The index of the profile that should be updated.</param> /// <param name="profile">The profile with its new values.</param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <bool> UpdateProfile(string groupId, string profileIndex, Data.HomematicIpObjects.Groups.Profile profile, CancellationToken cancellationToken = default) { var requestObject = new UpdateProfileRequestObject(groupId, profileIndex, profile); using var stringContent = GetStringContent(requestObject); using var httpResponseMessage = await HttpClient.PostAsync("hmip/group/heating/updateProfile", stringContent, cancellationToken); if (httpResponseMessage.IsSuccessStatusCode) { return(true); } throw new ArgumentException($"Request failed: {httpResponseMessage.ReasonPhrase}"); }
public UpdateProfileRequestObject(string groupId, string profileIndex, Data.HomematicIpObjects.Groups.Profile profile) { GroupId = groupId; ProfileIndex = profileIndex; Profile = profile; }