start method

  1. @override
Future<bool> start({
  1. bool refresh = false,
  2. String? key,
})
override

Implementation

@override
Future<bool> start({bool refresh = false, String? key}) async {
  bool ok = true;
  if (mqtt == null && url != null) {
    mqtt = IMqtt.create(url!, this, username: username, password: password);
  }
  if (mqtt != null) {
    ok = await mqtt!.connect();
    connected = ok;
  } else {
    connected = false;
    ok = false;
  }
  return ok;
}