Implementation of the LIFX LAN protocol in Swift based on Swift NIO. You can find a reference of the LIFX LAN PROTOCOL on lan.developer.lifx.com.
The repository contains a small example command-line tool that can be used to discover all devices on a network and toggle them on and off.
SwiftNIO LIFX is build using Swift and uses Swift Packages. You can learn more about the Swift Package Manager at swift.org.
If you use macOS, you can use Xcode to open the Package.swift
file at the root of the repository using Xcode. You can learn more on how to use Swift Packages with Xcode on developer.apple.com.
On plattforms that support the Swift Package Manager you can use the swift build
, swift run
, and swift tests
commands to build, run and test the source code.
⚠️ Be aware that UDP broadcast currently doesn't work in the Docker containers. If you want to test the device discovery, you need to run a docker container using the host network or directly run the code on the target platform.
If you are not using macOS or don't want to use Xcode, you can use Visual Studio Code using the Remote Containers plugin. You must install the latest version of Visual Studio Code, the latest version of the Remote Containers plugin and Docker.
- Open the folder using Visual Studio Code
- If you have installed the Remote Containers plugin Visual Studio Code automatically asks you to reopen the folder to develop in a container at the bottom right of the Visual Studio Code window.
- Press "Reopen in Container" and wait until the docker container is build
- You can now build the code using the build keyboard shortcut and run and test the code within the docker container using the Run and Debug area.