updatePluginInfo method

Future<bool> updatePluginInfo(
  1. String pluginId,
  2. String companyName,
  3. List<MultilingualValues> description
)

Update the information of the external plugin

Implementation

Future<bool> updatePluginInfo(String pluginId, String companyName,
    List<MultilingualValues> description) async {
  // Prepare the plugin node
  bool ret = await prepareRoot(
    [
      'Devices',
      currentDeviceId!,
    ],
  );
  if (ret == false) {
    log('Failed to prepare the plugin node');
    return false;
  }
  // Write plugin info
  Node node = NodeImpl(pluginId, pluginId, ":Devices:${currentDeviceId!}");
  await node.addOrUpdateValue(
    NodeValueImpl('name', pluginName),
  );
  await node.addOrUpdateValue(
    NodeValueImpl('company_name', companyName),
  );
  await addMultilingualValues(node, 'description', description);
  if (ret == false) {
    log('Failed to store plugin information');
    return false;
  }
  return true;
}