getFlic2ButtonByAddress method

Future<Flic2Button?> getFlic2ButtonByAddress(
  1. String buttonAddress
)

when a button is discovered, you can just get the bluetooth address, this let's you see if there's a button behind that

Implementation

Future<Flic2Button?> getFlic2ButtonByAddress(String buttonAddress) async {
  // scan for flic 2 buttons then please
  final buttonString = await _channel
      .invokeMethod<String?>(_methodNameGetButtonsByAddr, [buttonAddress]);
  if (buttonString == null || buttonString.isEmpty) {
    // not a valid button
    return null;
  } else {
    return _createFlic2FromData(buttonString);
  }
}