/// <summary> /// Sets a custom moodProperties for the group /// </summary> /// <param name="id">Id of the group</param> /// <param name="moodProperties">custom TradfriMoodProperties object which will be applied to all group bulbs</param> /// <returns></returns> public async Task SetMood(long id, TradfriMoodProperties moodProperties) { SwitchStateLightRequestOption set = new SwitchStateLightRequestOption() { IsOn = 1, Mood = 1 //hardcoded non-existing moodId }; await MakeRequest($"/{(int)TradfriConstRoot.Groups}/{id}", Call.PUT, content : moodProperties); await MakeRequest($"/{(int)TradfriConstRoot.Groups}/{id}", Call.PUT, content : set); }
public static ApiTradfriMoodProperties Map(TradfriMoodProperties moodProp) { return(moodProp != null ? new ApiTradfriMoodProperties { ColorHex = moodProp.ColorHex, ColorHue = moodProp.ColorHue, ColorSaturation = moodProp.ColorSaturation, ColorX = moodProp.ColorX, ColorY = moodProp.ColorY, Dimmer = moodProp.Dimmer, ID = moodProp.ID, LightState = moodProp.LightState, Mireds = moodProp.Mireds } : null); }