UNPKG

node-hue-api

Version:
36 lines (35 loc) 1.76 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createInsecureLocal = exports.createLocal = exports.createRemote = void 0; const LocalBootstrap_1 = require("./http/LocalBootstrap"); const LocalInsecureBootstrap_1 = require("./http/LocalInsecureBootstrap"); const RemoteBootstrap_1 = require("./http/RemoteBootstrap"); const HueApiRateLimits_1 = require("./HueApiRateLimits"); const DEFAULT_RATE_LIMIT_CONFIG = new HueApiRateLimits_1.HueApiRateLimits(); /** * Creates a remote bootstrap to connect with a Hue bridge remotely * @param clientId The OAuth client id for your application. * @param clientSecret The OAuth client secret for your application. */ function createRemote(clientId, clientSecret, rateLimits) { return new RemoteBootstrap_1.RemoteBootstrap(clientId, clientSecret, rateLimits || DEFAULT_RATE_LIMIT_CONFIG); } exports.createRemote = createRemote; /** * Creates a local network bootstrap to connect with Hue bridge on a local network. * @param host The IP Address or FQDN of the he bridge you are connecting to. * @param port The port number to connect to, optional. */ function createLocal(host, port, rateLimits) { return new LocalBootstrap_1.LocalBootstrap(host, rateLimits || DEFAULT_RATE_LIMIT_CONFIG, port); } exports.createLocal = createLocal; /** * Creates a local network bootstrap over an insecure HTTP connection. * @param host The IP Address or FQDN of the he bridge you are connecting to. * @param port The port number to connect to, optional. */ function createInsecureLocal(host, port, rateLimits) { return new LocalInsecureBootstrap_1.LocalInsecureBootstrap(host, rateLimits || DEFAULT_RATE_LIMIT_CONFIG, port); } exports.createInsecureLocal = createInsecureLocal;