Light class

Represents a Philips Hue light.

Inheritance

Constructors

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.
Light.empty()
Creates an empty Light object.
Light.fromJson(Map<String, dynamic> dataMap)
Creates a Light object from the JSON response to a GET request.
factory

Properties

alert LightAlert
The alerts associated with this light.
getter/setter pair
bridge Bridge?
The bridge that this resource is associated with.
getter/setter pairinherited
color LightColor
The color of this light.
getter/setter pair
colorTemperature LightColorTemperature
The color temperature of this light.
getter/setter pair
colorTemperatureDelta LightColorTemperatureDelta?
The change in color temperature of this light.
getter/setter pair
dimming LightDimmingFull
The brightness of this light.
getter/setter pair
dimmingDelta LightDimmingDelta?
The change to this light's dimming property.
getter/setter pair
dynamics LightDynamics
Details about this light's dynamics functionality.
getter/setter pair
effects LightEffects
Basic feature containing effect properties.
getter/setter pair
gradient LightGradientFull
Basic feature containing gradient properties.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
hueNetwork HueNetwork?
The HueNetwork that this resource is associated with.
getter/setter pairinherited
id String
Unique identifier representing a specific resource instance.
finalinherited
idV1 String
Clip v1 resource identifier.
final
isOn bool
Whether or not this light is on.
no setter
metadata LightMetadata
Metadata about this light.
getter/setter pair
mode LightMode
The mode this light is in.
final
on LightOn
On/Off state of the light on=true, off=false.
getter/setter pair
originalType ResourceType
no setterinherited
owner Relative
Owner of this light, in case the owner is deleted, this also gets deleted.
final
ownerAsResource Resource
Returns a Resource object that represents the owner of this Resource.
no setter
powerUp LightPowerUp
Feature containing properties to configure power up behavior of a light source.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signaling LightSignaling
Feature containing signaling properties.
final
timedEffects LightTimedEffects
Basic feature containing timed effect properties.
getter/setter pair
type ResourceType
Type of the supported resource.
getter/setter pairinherited

Methods

copyWith({ResourceType? type, String? id, String? idV1, Relative? owner, LightMetadata? metadata, LightOn? on, LightDimmingFull? dimming, Object? dimmingDelta = sentinelValue, LightColorTemperature? colorTemperature, Object? colorTemperatureDelta = sentinelValue, LightColor? color, LightDynamics? dynamics, LightAlert? alert, LightSignaling? signaling, LightMode? mode, LightGradientFull? gradient, LightEffects? effects, LightTimedEffects? timedEffects, LightPowerUp? powerUp, bool copyOriginalValues = true}) Light
Returns a copy of this object with its field values replaced by the ones provided to this method.
getRelativeAsResource(Relative relative) Resource
Returns a Resource object that represents the relative of this Resource.
inherited
getRelativesAsResources(List<Relative> relatives) List<Resource>
Returns a list of Resource objects that represent the relatives of this Resource.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshOriginals() → void
Called after a successful PUT request, this method refreshed the "original" data in this object.
override
toJson({OptimizeFor optimizeFor = OptimizeFor.put}) Map<String, dynamic>
Converts this object into JSON format.
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

sentinelValue → const Object
Used in the copyWith method to check if nullable values are meant to be copied over.