Swift library for LaMetric TIME
MIT License
Swift library for interacting with LaMetric TIME devices on the local network. You will need a developer account.
Note: macOS doesn't support the static image icon API yet.
import PackageDescription
let package = Package(
name: "MyAwesomeApp",
dependencies: [
.package(url: "https://github.com/ericlewis/swift-lametrickit", from: "0.2.0"),
]
)
Initialize a new LaMetricKit.Configuration
as follows:
let config = LaMetricKit.Configuration(
"8adaa0c98278dbb1ecb218d1c3e11f9312317ba474ab3361f80c0bd4f13a6749",
ipAddress: "192.168.1.101"
)
After creating your configuration you can use it with LaMetricKit
:
let notification = Notification {
Simple("Hello World!")
}
try await LaMetricKit(config).push(notification) // Watch your LaMetric!
Notfications are the high-level object we send to the device, it consists of a few properties and a collection of frames. Frames are the primary means of controlling the visual interface. Sounds and other settings are applied at the notification level.
Notification {
Simple("Hello World!")
Simple("How are you?") // multiple frames are this easy!
}
Notification(frames: [.simple(text: "Hello World!")])
Notification {
Simple("Hello!")
Chart([1, 2, 3, 4])
Progress(10, in: 0...100)
}
let morning = true
Notification {
if morning {
Simple("Good Morning!")
} else {
Simple("Where did the morning go?!")
}
}
UIImage
s as iconsNotification {
Simple("Hello World!", icon: .staticImage(UIImage(named: "HandWave")!))
}
LaMetricKit is released under the MIT license. See LICENSE for details.