UNPKG

matterbridge-roborock-vacuum-plugin

Version:
17 lines 541 B
export class ModeHandlerRegistry { handlers = []; register(handler) { this.handlers.push(handler); return this; } async handle(duid, mode, activity, context) { const handler = this.handlers.find((h) => h.canHandle(mode, activity)); if (handler) { await handler.handle(duid, mode, activity, context); } else { context.logger.notice(`${context.behaviorName}-changeToMode-Unknown: `, mode); } } } //# sourceMappingURL=modeHandlerRegistry.js.map