Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g123k/dart_elgato_keylights_api
A wrapper for the Elgato Keylights API in Dart
https://github.com/g123k/dart_elgato_keylights_api
dart elgato flutter
Last synced: about 1 month ago
JSON representation
A wrapper for the Elgato Keylights API in Dart
- Host: GitHub
- URL: https://github.com/g123k/dart_elgato_keylights_api
- Owner: g123k
- License: apache-2.0
- Created: 2022-08-17T07:12:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-28T19:26:19.000Z (about 2 years ago)
- Last Synced: 2024-04-20T15:18:49.681Z (7 months ago)
- Topics: dart, elgato, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/elgato_keylight_api
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Elgato Keylight API for Dart
## Features
This package provides an API for Elgato Keylights.
## Not covered
This plugin doesn't handle how to find a light IP address in your network. The [multicast_dns library](https://pub.dev/packages/multicast_dns) should help you by using this query:
```dart
ResourceRecordQuery.serverPointer('_elg._tcp.local');
```## Getting started
For each light, you first have to create an `ElgatoKeylightAPI` object:
```dart
ElgatoKeylightAPI api = ElgatoKeylightAPI(
ip: 'elgato-key-light-air-ace6.local',
port: 9123,
);
```## Get light info
There are three endpoints available:
- `getLightOptions`
- `getLightAccessoryInfo`
- `getLightSettings`## Update a light
After calling `getLightOptions()`, update the object and send it to `updateLightOptions()`:
```dart
KeyLightOptions lightOptions = await api.getLightOptions();api.updateLightOptions(
lightOptions.updateWith(on: !lightOptions.lights.first.isOn),
);
```## Example of data
- Light accessory:
```json
{
productName: "Elgato Key Light Air",
hardwareBoardType: 200,
firmwareBuildNumber: 216,
firmwareVersion: "1.0.3", serialNumber: "XXX",
displayName: "May be empty",
features: ["lights"],
wifi: {
ssid: "XXX",
frequency: 1234,
rssi: -1
}
}
```
- Light settings:
```json
{
powerOnBehavior: 1,
powerOnBrightness: 20,
powerOnTemperature: 213,
switchOnDurationMs: 100,
switchOffDurationMs: 300,
colorChangeDurationMs: 100
}
```- Light options:
```json
{
number: 1,
lights: [
{
isOn: true,
brightness: 28,
temperature: 279
}
]
```