getResource method
Fetch all resources of the given resource type from this bridge.
token is the access token for remote access.
Will return null if:
- This bridge does not have an IP address
- This bridge does not have an application key
- Any other unforeseen error
Implementation
Future<List<Map<String, dynamic>>?> getResource(
  ResourceType type, {
  String? token,
}) async {
  if (ipAddress == null) return null;
  if (applicationKey == null) return null;
  try {
    final Map<String, dynamic>? result = await HueHttpRepo.get(
      bridgeIpAddr: ipAddress!,
      applicationKey: applicationKey!,
      resourceType: type,
      token: token,
    );
    if (result == null) return null;
    return MiscTools.extractDataList(result);
  } catch (_) {
    return null;
  }
}