jmb_aqualight 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 58

A library for Dart developers that want to interact with the JMB Aqualight.

This library communicates over UDP with your controller. Make sure that your are connected to the controller's WiFi network.

This library is currently used by the JMB Aqualight apps. Available for iOS and Android.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:jmb_aqualight/jmb_aqualight.dart';

main() async {

  // Connect with your controller.
  var connectionInfo = await connect();

  // Synchronize time.
  await timeSync(connectionInfo);
}

For any other usages, see the example in example/jmb_aqualight_example.dart.

Developer notes #

To publish, run pub publish (--dry-run). Make sure to update the version number.

1.0.3 #

  • Fixed major bug in connection.

1.0.2 #

  • Code formatting.

1.0.1 #

  • Tested the software.
  • Minor changes to prevent warnings from pub.dev.

1.0.0 #

  • Initial version, created by Stagehand.

example/jmb_aqualight_example.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();

  var command = arguments.isEmpty ? 'schedule' : arguments[0];

  if (command == 'live') {
    await liveSchedule(connectionInfo, SCHEDULE, false);
  } else if (command == 'sync') {
    await timeSync(connectionInfo);
  } else if (command == 'schedule') {
    await uploadSchedule(connectionInfo, SCHEDULE);
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  jmb_aqualight: ^1.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:jmb_aqualight/jmb_aqualight.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Mar 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
Dev dependencies
pedantic ^1.8.0