UNPKG

node-hue-api

Version:
47 lines (46 loc) 1.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Configuration = void 0; const configuration_1 = require("./http/endpoints/configuration"); const ApiDefinition_1 = require("./http/ApiDefinition"); class Configuration extends ApiDefinition_1.ApiDefinition { constructor(hueApi) { super(hueApi); } /** * Obtains the complete configuration from the Hue Bridge in a raw Object format that is returned from the API. * This function will return all the config along with all the lights, schedules, groups, scenes, resourcelinks, etc... * * @returns The raw data returned from the Hue Bridge */ getAll() { return this.execute(configuration_1.configurationApi.getFullState); } /** * Gets the unauthenticated configuration data from the bridge. * @returns The unauthenticated configuration data from the bridge. */ getUnauthenticatedConfig() { return this.execute(configuration_1.configurationApi.getUnauthenticatedConfig); } /** * Updates a configuration value for the Hue Bridge. * @param data The data that is to be updated for the bridge configuration. */ updateConfiguration(data) { return this.execute(configuration_1.configurationApi.updateConfiguration, { config: data }); } getConfiguration() { return this.execute(configuration_1.configurationApi.getConfiguration); } /** * A virtual press of the link button to perform pairing of software/services. This no longer works on the local * network connection due to security implications which led to it being disabled by Hue developers. * * This will function if you are using the library over the remote API/portal though. */ pressLinkButton() { return this.execute(configuration_1.configurationApi.updateConfiguration, { linkbutton: true }); } } exports.Configuration = Configuration;