Light constructor
Light({
- required ResourceType type,
- required String id,
- String idV1 = "",
- required Relative owner,
- LightMetadata? metadata,
- required LightOn on,
- required LightDimmingFull dimming,
- LightDimmingDelta? dimmingDelta,
- required LightColorTemperature colorTemperature,
- LightColorTemperatureDelta? colorTemperatureDelta,
- required LightColor color,
- required LightDynamics dynamics,
- required LightAlert alert,
- required LightSignaling signaling,
- required LightMode mode,
- required LightGradientFull gradient,
- required LightEffects effects,
- required LightTimedEffects timedEffects,
- 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();