{"version":3,"sources":["jsdelivr-header.js","/npm/raxa-plugin-scenery@0.3.2/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,MAAM,cAAgB,QAAQ,eACxB,SAAW,QAAQ,YACzB,MAAM,sBAAsB,cAAc,OACtC,KAAA,GACI,OAAO,OAAO,KAAK,MAAM,WAAW,SAAS,SAAS,IAClD,GAAI,EAAO,WAAa,SAAS,QAAQ,GAAI,CACzC,MAAM,EAAgB,EAAO,OAAO,cAChC,EAAc,MAAM,QAAuC,IAAtB,EAAa,QAClD,KAAK,SAAS,cAAc,QAAQ,cAAe,CAC/C,OAAQ,OAAO,OAAO,OAAO,OAAO,CAAC,EAAG,GAAS,CAAE,OAAQ,OAAO,OAAO,OAAO,OAAO,CAAC,EAAG,EAAO,QAAS,CAAE,cAAe,EAAc,KAAK,GAAkB,OAAO,OAAO,CAEnK,KAAM,gBAAkB,UAGhD,IAER,CACA,oBAAM,CAAe,EAAG,GACpB,KAAK,IAAI,MAAM,CAAE,WAAY,EAAO,MAAQ,yBACtC,QAAQ,IAAI,EAAO,OAAO,cAAc,KAAK,GAA2B,iBAAhB,EAAO,KAC/D,KAAK,gBAAgB,GACrB,KAAK,WAAW,KAC1B,EAEJ,QAAQ,QAAU","file":"/npm/raxa-plugin-scenery@0.3.2/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/raxa-plugin-scenery@0.3.2/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst raxa_common_1 = require(\"raxa-common\");\nconst plugin_1 = require(\"./plugin\");\nclass SceneryPlugin extends raxa_common_1.Plugin {\n    start() {\n        Object.values(this.state.getState().devices).forEach((device) => {\n            if (device.pluginId === plugin_1.default.id) {\n                const modifications = device.config.modifications;\n                if (modifications.some((modification) => modification.type === undefined)) {\n                    this.dispatch(raxa_common_1.actions.deviceUpdated, {\n                        device: Object.assign(Object.assign({}, device), { config: Object.assign(Object.assign({}, device.config), { modifications: modifications.map((modification) => (Object.assign({ \n                                    // @ts-ignore\n                                    type: 'modification' }, modification))) }) }),\n                    });\n                }\n            }\n        });\n    }\n    async onDeviceCalled(_, device) {\n        this.log.debug({ deviceName: device.name }, 'Setting scenery');\n        await Promise.all(device.config.modifications.map((action) => action.type === 'modification'\n            ? this.setDeviceStatus(action)\n            : this.callDevice(action)));\n    }\n}\nexports.default = SceneryPlugin;\n"]}