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 ColorLights, InfraredLights, MultiZoneLights and Tiles.

  • 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 this Device.

    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 the Device.

    Declaration

    Swift

    public private(set) lazy var location: FutureValue<Location> { get set }
  • The Group the Device 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>
  • Set the Location of the Device.

    Declaration

    Swift

    public func set(location: Location) -> EventLoopFuture<Location>
  • Set the Group of the Device.

    Declaration

    Swift

    public func set(group: Group) -> EventLoopFuture<Group>
  • Update the cachedValues of this Device from a previous version of this Device.

    Precondition

    The address of the oldDevice must be the same as the address of this device.

    Declaration

    Swift

    public func updateCachedValues(from oldDevice: Device)

    Parameters

    oldDevice

    The old Device that is used to update the cached values of this Device.

  • 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 more

    Declaration

    Swift

    public struct Firmware
  • Group of a Device.

    The LIFX Application allows users to organise each bulb by giving it a Group and a Location. 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. These Group and Location 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.

    See more

    Declaration

    Swift

    public struct Group
    extension Device.Group: CustomStringConvertible
  • Provides the hardware version of the light. See LIFX Products for how to interpret the vendor and product ID fields.

    See more

    Declaration

    Swift

    public struct HardwareInfo
  • Location of a Device.

    The LIFX Application allows users to organise each bulb by giving it a Group and a Location. 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. These Group and Location 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.

    See more

    Declaration

    Swift

    public struct Location
    extension Device.Location: CustomStringConvertible
  • Describes the power level of a Device.

    See more

    Declaration

    Swift

    public enum PowerLevel : UInt16
    extension Device.PowerLevel: CustomStringConvertible
  • Provides run-time information of a Device.

    See more

    Declaration

    Swift

    public struct RuntimeInfo
  • The Service and IP port number used by a LIFX device to communicate with this Device.

    See more

    Declaration

    Swift

    public struct Service
  • Describes the services exposed by the light.

    The LIFX Protocol currently utilizes UDP/IP for all messages.

    See more

    Declaration

    Swift

    public enum ServiceType : UInt8
  • Describes the transmisson information of a Device subsystem.

    See more

    Declaration

    Swift

    public struct TransmissionInfo