Bulb Types - bharat-1809/wizctl GitHub Wiki

Bulb Types

Bulb capabilities are detected from the module name returned by the light.

final config = await light.getSystemConfig();
final bulb = config.bulbClass;

if (bulb?.supportsColor == true) {
  await light.setColor(255, 0, 0);
}
Type Color Temp Dim
RGB
Tunable White
Dimmable White
Socket
Fan Dimmer

Kelvin range

Each bulb reports its supported color temperature range:

final range = await light.getKelvinRange();
// range.min, range.max

if (range.contains(3000)) {
  await light.setTemperature(3000);
}

// Clamp to valid range
final temp = range.clamp(1500);  // Returns min if below