Light constructor

Light({
  1. required ResourceType type,
  2. required String id,
  3. String idV1 = "",
  4. required Relative owner,
  5. LightMetadata? metadata,
  6. required LightOn on,
  7. required LightDimmingFull dimming,
  8. LightDimmingDelta? dimmingDelta,
  9. required LightColorTemperature colorTemperature,
  10. LightColorTemperatureDelta? colorTemperatureDelta,
  11. required LightColor color,
  12. required LightDynamics dynamics,
  13. required LightAlert alert,
  14. required LightSignaling signaling,
  15. required LightMode mode,
  16. required LightGradientFull gradient,
  17. required LightEffects effects,
  18. required LightTimedEffects timedEffects,
  19. required LightPowerUp powerUp,
})

Creates a Light object.

Implementation

Light({
  required super.type,
  required super.id,
  this.idV1 = "",
  required this.owner,
  LightMetadata? metadata,
  required this.on,
  required this.dimming,
  this.dimmingDelta,
  required this.colorTemperature,
  this.colorTemperatureDelta,
  required this.color,
  required this.dynamics,
  required this.alert,
  required this.signaling,
  required this.mode,
  required this.gradient,
  required this.effects,
  required this.timedEffects,
  required this.powerUp,
})  : assert(idV1.isEmpty || Validators.isValidIdV1(idV1),
          '"$idV1" is not a valid `idV1`'),
      metadata = metadata ?? LightMetadata.empty(),
      _originalMetadata = metadata?.copyWith() ?? LightMetadata.empty(),
      _originalOn = on.copyWith(),
      _originalDimming = dimming.copyWith(),
      _originalDimmingDelta = dimmingDelta?.copyWith(),
      _originalColorTemperature = colorTemperature.copyWith(),
      _originalColorTemperatureDelta = colorTemperatureDelta?.copyWith(),
      _originalColor = color.copyWith(),
      _originalDynamics = dynamics.copyWith(),
      _originalAlert = alert.copyWith(),
      _originalGradient = gradient.copyWith(),
      _originalEffects = effects.copyWith(),
      _originalTimedEffects = timedEffects.copyWith(),
      _originalPowerUp = powerUp.copyWith();