public async Task SetColorAsync(ILightingZone zone, Color color) { if (color == Color.White) { var cmds = GetZoneCommands(zone); await SendAsync(cmds.White.Value); } else { await TurnOnAsync(zone); await SendAsync(0x40, ConvertColor(color)); } }
public Task TurnOffAsync(ILightingZone zone) { var cmds = GetZoneCommands(zone); return(SendAsync(cmds.Off)); }
public async Task SetBrightnessAsync(ILightingZone zone, Brightness brightness) { await TurnOnAsync(zone); await SendAsync(0x4E, ConvertBrightness(brightness)); }
private ZoneCommandInfo GetZoneCommands(ILightingZone zone) { return(_zoneCommands[zone]); }