jmb_aqualight 2.0.2 jmb_aqualight: ^2.0.2 copied to clipboard
Library to interact with the JMB Aqualight controller over UDP.
example/jmb_aqualight_example.dart
import 'package:jmb_aqualight/src/packets_general.dart';
import 'package:jmb_aqualight/src/packets_live.dart';
import 'package:jmb_aqualight/src/send.dart';
import 'package:jmb_aqualight/jmb_aqualight.dart';
const schedule = [
[100, 100, 100, 100, 100], // 00:00
[0, 0, 0, 0, 0], // 00:30
[10, 100, 50, 0, 0], // 01:00
[10, 100, 0, 50, 0], // 01:30
[10, 100, 0, 0, 50], // 02:00
[10, 40, 100, 0, 0], // 02:30
[10, 40, 0, 100, 0], // 03:00
[10, 40, 0, 0, 100], // 03:30
[10, 0, 50, 0, 0], // 04:00
[10, 100, 100, 100, 100], // 04:30
[50, 0, 0, 0, 0], // 05:00
[50, 0, 0, 0, 0], // 05:30
[50, 0, 0, 0, 0], // 06:00
[50, 0, 0, 0, 0], // 06:30
[50, 0, 0, 0, 0], // 07:00
[50, 0, 0, 0, 0], // 07:30
[50, 0, 0, 0, 0], // 08:00
[50, 0, 0, 0, 0], // 08:30
[50, 0, 0, 0, 0], // 09:00
[50, 0, 0, 0, 0], // 09:30
[50, 0, 0, 0, 0], // 10:00
[50, 0, 0, 0, 0], // 10:30
[100, 0, 0, 0, 0], // 11:00
[100, 0, 0, 0, 0], // 11:30
[100, 0, 0, 0, 0], // 12:00
[100, 0, 0, 0, 0], // 12:30
[100, 0, 0, 0, 0], // 13:00
[100, 0, 0, 0, 0], // 13:30
[100, 0, 0, 0, 0], // 14:00
[0, 0, 0, 0, 0], // 14:30
[100, 0, 0, 0, 0], // 15:00
[100, 0, 0, 0, 0], // 15:30
[100, 0, 0, 0, 0], // 16:00
[20, 0, 0, 0, 0], // 16:30
[20, 0, 0, 0, 0], // 17:00
[20, 0, 0, 0, 0], // 17:30
[20, 0, 0, 0, 0], // 18:00
[20, 0, 0, 0, 0], // 18:30
[20, 0, 0, 0, 0], // 19:00
[100, 0, 0, 0, 0], // 19:30
[100, 0, 0, 0, 0], // 20:00
[100, 0, 0, 0, 0], // 20:30
[100, 0, 0, 0, 0], // 21:00
[0, 0, 0, 0, 0], // 21:30
[0, 0, 0, 0, 0], // 22:00
[0, 0, 0, 0, 0], // 22:30
[0, 0, 0, 0, 0], // 23:00
[0, 0, 0, 0, 0] // 23:30
];
void main(List<String> arguments) async {
var connectionInfo = await connect();
final controllerId = connectionInfo.controllerId;
final packets = <Packet>[];
packets.add(createLiveStartPacket(controllerId));
packets.add(createLiveDataPacket(controllerId, [5, 0, 0, 0, 0]));
await sendPackets(packets);
await Future.delayed(Duration(seconds: 5));
packets.add(createLiveEndPacket(controllerId));
await sendPackets(packets);
}