/// <summary> /// Sets the brightness for a group or all RGBW bulbs. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> /// <param name="percentage">The percentage (0-100) of brightness to set.</param> public void SetBrightness(int group, int percentage) { CheckGroup(group); // Check and select SelectGroup(group); var command = new byte[] { BRIGHTNESS, BrightnessToMiLight(percentage), END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Turns down the brightness for the specified group of /// white lightbulbs. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public void BrightnessDown(int group) { CheckGroup(group); // Check and select SelectGroup(group); var command = new [] { BRIGHTDOWN, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Speeds down the current effect for a group or all RGBW bulbs. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public void SpeedDown(int group) { CheckGroup(group); // Check and select SelectGroup(group); var command = new [] { SPEEDDOWN, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Turns down the temperature of a group of white lights (cooler). /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public void Cooler(int group) { CheckGroup(group); // Check and select SelectGroup(group); var command = new [] { COOLER, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Sets a given group of RGBW bulbs to the specified color's hue. Does not /// support Saturation and Luminosity/Brightness of the color. /// For a better representation of the color use <see cref="SetTrueColor"/>. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> /// <param name="color">The <see cref="System.Drawing.Color"/> to set.</param> public void SetColor(int group, Color color) { CheckGroup(group); // Check and select SelectGroup(group); var command = new [] { HUE, HueToMiLight(color.GetHue()), END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Switches the 'disco' mode of a group or all RGBW bulbs. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public void CycleMode(int group) { CheckGroup(group); // Check and select SelectGroup(group); var command = new [] { MODE, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Sets a given group of RGBW bulbs to the specified hue. /// </summary> /// <remarks> /// MiLight bulbs do not support Saturation and Luminosity/Brightness. /// Use <see cref="SetTrueColor"/> for a beter representation of the color. /// </remarks> /// <param name="group">1-4 or 0 for all groups.</param> /// <param name="hue">The hue to set (0 - 360 degrees).</param> public void SetHue(int group, float hue) { CheckGroup(group); // Check and select SelectGroup(group); var command = new [] { HUE, HueToMiLight(hue), END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Sets the 'Night' mode for the specified group or all RGBW bulbs. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public void SetNightMode(int group) { CheckGroup(group); // Just check var command = new byte[] { OFF[group], NIGHT[group], END }; MiLightGateway.SendCommand(command); ActiveGroup = group; }
/// <summary> /// Switches the specified group or all RGBW bulbs to white. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public void SwitchWhite(int group) { CheckGroup(group); // Just check var command = new [] { WHITE[group], ZERO, END }; MiLightGateway.SendCommand(command); ActiveGroup = group; }
/// <summary> /// Switches 'off' one or all white lightbulbs. /// </summary> /// <param name="group">1-4 or 0 for all groups.</param> public override void SwitchOff(int group) { CheckGroup(group); // Just check var command = new [] { OFF[group], ZERO, END }; MiLightGateway.SendCommand(command); ActiveGroup = group; }
/// <summary> /// Speeds up the current effect of the RGB bulb(s)/strip(s) /// </summary> public void SpeedUp() { var command = new [] { SPEEDUP, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Switches to the next effect of the RGB bulb(s)/strip(s) /// </summary> public void NextEffect() { var command = new [] { NEXTEFFECT, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Sets the give hue of the RGB bulb(s)/strip(s) /// </summary> /// <param name="hue">Hue in 0.0 - 360.0 degrees.</param> public void SetHue(float hue) { var command = new [] { HUE, HueToMiLight(hue), END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Turns down the brightness of the RGB bulb(s)/strip(s) /// </summary> public void BrightnessDown() { var command = new [] { BRIGHTDOWN, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Turns up the brightness of the RGB bulb(s)/strip(s) /// </summary> public void BrightnessUp() { var command = new [] { BRIGHTUP, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Switches 'off' the RGB bulb(s)/strip(s). Groups are not used in the /// context of RGB bulb(s)/strip(s), so this is default set to 0 and does /// not have to be specified. /// </summary> public override void SwitchOff() { var command = new [] { OFF, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Speeds down the current effect of the RGB bulb(s)/strip(s) /// </summary> public void SpeedDown() { var command = new [] { SPEEDDOWN, ZERO, END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Sets the color of the RGB bulb(s)/strips(s). Translates /// to hue, no brightness or saturation taken in consideration. /// </summary> /// <param name="color">The 'System.Drawing.Color' to set.</param> public void SetColor(Color color) { var command = new [] { HUE, HueToMiLight(color.GetHue()), END }; MiLightGateway.SendCommand(command); }
/// <summary> /// Switches to the previous effect of the RGB bulb(s)/strip(s) /// </summary> public void PreviousEffect() { var command = new [] { PREVEFFECT, ZERO, END }; MiLightGateway.SendCommand(command); }