addBridge method

bool addBridge(
  1. Bridge bridge
)

Adds a bridge to the bridges list.

Returns true if the bridge was added to the list.

If the bridge does not have an IP address, it will not be added to the list, and false will be returned.

Implementation

bool addBridge(Bridge bridge) {
  if (bridge.ipAddress == null || bridge.applicationKey == null) {
    return false;
  }

  bridge.hueNetwork = this;

  _bridges.add(bridge);

  return true;
}