https://github.com/robertodoering/sunix_ledstrip_controller
A dart library for controlling the Sunix® RGB / RGBWWCW WiFi LED strip controller
https://github.com/robertodoering/sunix_ledstrip_controller
dart-library flutter-package led-controller leds ledstrip sunix sunix-ledstrip-controller
Last synced: 12 months ago
JSON representation
A dart library for controlling the Sunix® RGB / RGBWWCW WiFi LED strip controller
- Host: GitHub
- URL: https://github.com/robertodoering/sunix_ledstrip_controller
- Owner: robertodoering
- License: bsd-2-clause
- Created: 2018-09-22T23:32:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-14T19:30:15.000Z (about 6 years ago)
- Last Synced: 2025-02-24T08:56:39.615Z (about 1 year ago)
- Topics: dart-library, flutter-package, led-controller, leds, ledstrip, sunix, sunix-ledstrip-controller
- Language: Dart
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Sunix ledstrip controller
A dart library for controlling the Sunix® RGB / RGBWWCW WiFi LED strip controller.
## Features
- Power the controller off and on
- Change the color of the led controller
- For RGB or RGBWWCW (warm white and cold white) colors
- Receive the current status of the controller, including the power state and color values
- Send multiple requests in quick succession
- Can be used to create a smooth transition from one color to another
## Installation
You can install the package by adding the following to your `pubspec.yaml`:
```yaml
dependencies:
sunix_ledstrip_controller: ^1.0.2
```
## Usage
A simple usage example:
```dart
import 'package:sunix_ledstrip_controller/sunix_ledstrip_controller.dart';
main() async {
// create a new controller object with a static ip
LedController controller = LedController("192.168.178.50");
// power the controller on
if (await controller.powerOn()) {
// methods return true when the request was successfully sent
print("successfully powered on");
}
// change the controller color
controller.updateColorRgb(192, 255, 238);
// get the status of the controller
StatusResponse status;
await controller
.requestStatus()
.then((response) => status = response);
print("powered on: ${status?.poweredOn}");
print("red: ${status?.red}");
print("blue: ${status?.green}");
print("green: ${status?.blue}");
}
```
## Example
See the `example` directory for a basic example.
## Attributions
A big thanks goes to [@markusressel](https://github.com/markusressel) for his python library [sunix-ledstrip-controller-client](https://github.com/markusressel/sunix-ledstrip-controller-client).