Device
public class Device
extension Device: CustomStringConvertible
extension Device: Equatable
extension Device: Hashable
A Device
, is a LIFX product independent of its specific type.
Device messages control and acquire the state of the Devices
.
The state of a Device
is composed of the service
, port
, hardwareInfo
, firmware
,
transmissionInfo
, powerLevel
, runtimeInfo
, label
, location
, and group
.
These properties are common to all LIFX devices, which may also implement device specific behaviour,
such as ColorLight
s, InfraredLight
s, MultiZoneLight
s and Tile
s.
-
6 byte device address (MAC address) of the
Target
.Declaration
Swift
public let address: UInt64
-
The
Service
and IP port number used by a LIFX device to communicate with thisDevice
.Declaration
Swift
public private(set) lazy var service: FutureValue<Service> { get set }
-
Hardware information about the
Device
.Declaration
Swift
public private(set) lazy var hardwareInfo: FutureValue<HardwareInfo> { get set }
-
Firmware information about the
Device
.Declaration
Swift
public private(set) lazy var firmware: FutureValue<Firmware> { get set }
-
Transmission information about the
Device
.Declaration
Swift
public private(set) lazy var transmissionInfo: FutureValue<TransmissionInfo> { get set }
-
The power level of the
Device
.Declaration
Swift
public private(set) lazy var powerLevel: FutureValue<PowerLevel> { get set }
-
The power level of the
Device
.Declaration
Swift
public private(set) lazy var runtimeInfo: FutureValue<RuntimeInfo> { get set }
-
The label describing the
Device
.Declaration
Swift
public private(set) lazy var label: FutureValue<String> { get set }
-
The
Location
of theDevice
.Declaration
Swift
public private(set) lazy var location: FutureValue<Location> { get set }
-
The
Group
theDevice
belongs to.Declaration
Swift
public private(set) lazy var group: FutureValue<Group> { get set }
-
Undocumented
Declaration
Swift
public func loadBasicInformation() -> EventLoopFuture<Void>
-
Set the power level of the
Device
.Declaration
Swift
public func set(powerLevel: PowerLevel) -> EventLoopFuture<PowerLevel>
-
Set the label of the
Device
.Declaration
Swift
public func set(label: String) -> EventLoopFuture<String>
-
Update the cachedValues of this
Device
from a previous version of thisDevice
.Declaration
Swift
public func updateCachedValues(from oldDevice: Device)
Parameters
oldDevice
The old
Device
that is used to update the cached values of thisDevice
. -
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public static func == (lhs: Device, rhs: Device) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Describes the MCU (Microcontroller unit) firmware information
See moreDeclaration
Swift
public struct Firmware
-
Group of a
Device
.The LIFX Application allows users to organise each bulb by giving it a
See moreGroup
and aLocation
. Most users use groups to represent a room, and location to represent a property (such as a house or office) but this does not need to be the case. TheseGroup
andLocation
are stored on the bulbs themselves, and are designed so that they can be modified or renamed as long as one of the bulbs in the affected group is powered on.Declaration
-
Provides the hardware version of the light. See LIFX Products for how to interpret the vendor and product ID fields.
See moreDeclaration
Swift
public struct HardwareInfo
-
Location of a
Device
.The LIFX Application allows users to organise each bulb by giving it a
See moreGroup
and aLocation
. Most users use groups to represent a room, and location to represent a property (such as a house or office) but this does not need to be the case. TheseGroup
andLocation
are stored on the bulbs themselves, and are designed so that they can be modified or renamed as long as one of the bulbs in the affected group is powered on.Declaration
-
Describes the services exposed by the light.
The LIFX Protocol currently utilizes UDP/IP for all messages.
See moreDeclaration
Swift
public enum ServiceType : UInt8