async function createPlugin (context = '/') { const app = await new App(context).init() const api = new PluginAPI(app, { entry: { options: {}, clientOptions: undefined }}) return { app, api } }
beforeEach(async () => { app = await new App(__dirname, { config: { plugins: [] } }).init() api = new PluginAPI(app, { entry: { options: {}, clientOptions: undefined } }) })
describe('PhilipsHueService', () => { it('should get scenes', async () => { const philipsHueService = PhilipsHueService(gladys, 'a810b8db-6d04-4697-bed3-c4b72c996279'); await philipsHueService.device.init(); await philipsHueService.device.activateScene('1234', 'scene-id'); }); });
setWidgetsInit () { for (let widgetObject of this.widgetsRepository.values()) { widgetObject.init() } }
async function main() { const store = createStore(reducer, applyMiddleware(reduxMiddleware)); console.info('Popup: Init bridge and restore state...'); await bridge().init(window.browser ? window.browser : window.chrome, !!window.browser, store); console.info('Popup: Creating React app...'); ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); }
async componentDidMount() { const session = await NextAuth.init({force: true}) this.setState({ session: session, isSignedIn: (session.user) ? true : false }) // If the user bounces off to link/unlink their account we want them to // land back here after signing in with the other service / unlinking. const cookies = new Cookies() cookies.set('redirect_url', window.location.pathname, { path: '/' }) this.getProfile() }
constructor (name) { this.LS = null this.name = name this.checkLS() this.init(name) }
beforeEach(async () => { system = new System(sequelize, event, config); await system.init(); // Reset all fakes invoked within init call sinon.reset(); });
async function createSchemaAndExecute (query) { const app = await new App(__dirname, { plugins: [createCollections] }).init() await app.plugins.loadSources() return app.schema.buildSchema().runQuery(query) }
describe('PhilipsHueService', () => { it('should get scenes', async () => { const philipsHueService = PhilipsHueService(gladys, 'a810b8db-6d04-4697-bed3-c4b72c996279'); await philipsHueService.device.init(); const scenes = await philipsHueService.device.getScenes(); scenes.forEach((scene) => { expect(scene).to.have.property('id'); expect(scene).to.have.property('name'); expect(scene).to.have.property('bridge_serial_number'); }); }); });
constructor(...serviceConfig) { super(...serviceConfig); this.isDBReady = false; this.db = this.loadDatabase(); this.init(); }
constructor (searchData) { this.searchData = searchData this.init() this.titleHitsRes = [] }
/** * @public * @description This function starts the PhilipsHueService service * @example * gladys.services['philips-hue'].start(); */ async function start() { logger.log('starting Philips Hue service'); philipsHueLightHandler.init(); }
_dereq_(121)('Int8', 1, function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; });
/** * @public * @description This function starts the PhilipsHueService service * @example * gladys.services['philips-hue'].start(); */ async function start() { logger.log('starting Philips Hue service'); philipsHueLightHandler.init(); }