/** * @public * @description This function starts the service * @example * gladys.services.usb.start(); */ async function start() { logger.info('Starting usb service'); }
/** * @public * @description This function stops the service * @example * gladys.services.usb.stop(); */ async function stop() { logger.log('stopping usb service'); }
/** * @description Disconnect telegram API * @example * disconnect(); */ async function disconnect() { logger.debug('Disconnecting Telegram API'); if (this.bot) { await this.bot.stopPolling(); } this.bot = null; }
const displayNumberOfEventProcessedBySeconds = (time) => { const seconds = process.hrtime(time)[0]; const elapsed = seconds + process.hrtime(time)[1] / 1000000 / 1000; const perSecond = (NUMBER_OF_SCENE_TO_REGISTER * NUMBER_OF_ACTIONS_PER_SCENE) / elapsed; const millionsEventProcessedPerSecond = perSecond / 1000000; const millionsEventProcessedPerSecondBeautiful = Math.round(millionsEventProcessedPerSecond * 100) / 100; logger.info( `Executed 1 million actions in ${elapsed} s, so ${millionsEventProcessedPerSecondBeautiful}M actions/per second`, ); }
/** * @description TurnOn a given deviceFeature. * @param {Object} device - The device to turnOn. * @param {Object} deviceFeature - The deviceFeature to turnOn. * @example * light.turnOn(device, deviceFeature); */ async function turnOn(device, deviceFeature) { logger.debug(`Turning on the light of deviceFeature "${deviceFeature.selector}"`); await this.deviceManager.setValue(device, deviceFeature, STATE.ON); this.eventManager.emit(EVENTS.LIGHT.TURNED_ON, { device, deviceFeature }); }
/** * @public * @description This function starts service * @example * gladys.services['rtsp-camera'].start(); */ async function start() { logger.log('starting RTSP service'); // make sure the tempFolder exists await fse.ensureDir(gladys.config.tempFolder); }
/** * @description When a node event is received. * @param {number} nodeId - The ID of the node. * @param {Object} data - The event. * @example * zwave.on('node event', this.nodeEvent); */ function nodeEvent(nodeId, data) { logger.debug(`Zwave : Node Event, nodeId = ${nodeId}, data = ${data}`); }
/** * @public * @description This function stops the TelegramService * @example * gladys.services.telegram.stop(); */ async function stop() { logger.log('stopping telegram service'); await messageHandler.disconnect(); }
/** * @public * @description This function stops the CalDAV service * and clear sync interval * @example * gladys.services.caldav.stop(); */ async function stop() { logger.log('stopping CalDAV service'); clearInterval(interval); }
/** * @public * @description This function stops the service * @example * gladys.services['rtsp-camera'].stop(); */ async function stop() { logger.log('stopping RTSP service'); }
/** * @public * @description This function stops the service * @example * gladys.services['rtsp-camera'].stop(); */ async function stop() { logger.log('stopping RTSP service'); }
/** * @public * @description This function starts the service * @example * gladys.services.usb.start(); */ async function start() { logger.info('Starting usb service'); }
/** * @public * @description This function stops the service * @example * gladys.services.openWeather.stop(); */ async function stop() { logger.log('stopping Open Weather service'); }
/** * @description Disconnect telegram API * @example * disconnect(); */ async function disconnect() { logger.debug('Disconnecting Telegram API'); if (this.bot) { await this.bot.stopPolling(); } this.bot = null; }
/** * @public * @description This function stops the service * @example * gladys.services.usb.stop(); */ async function stop() { logger.log('stopping usb service'); }