wake method Null safety

Future<bool> wake()

Implementation

Future<bool> wake() async {
  var address = '192.168.255.255'; // broadcast address
  if (MACAddress.validate(_macAddress) == false) {
    print('Samsung::wake() invalid mac');
    return false;
  }
  if (IPv4Address.validate(address) == false) {
    print('Samsung::wake() invalid ip');
    return false;
  }

  final ip = IPv4Address.from(address);
  final mac = MACAddress.from(_macAddress);
  await WakeOnLAN.from(ip, mac, port: 9).wake();
  return true;
}