├── .nvmrc ├── .homeyignore ├── .gitignore ├── docs ├── tutorials │ ├── migrate.json │ └── migrate.md ├── jsdoc.json ├── README.md └── api.js ├── .prettierrc ├── assets ├── images │ ├── large.png │ ├── small.png │ └── xlarge.png └── icon.svg ├── examples-v1 ├── global-set.js ├── hello-world.js ├── lodash.js ├── global-get.js ├── wait.js ├── say.js ├── condition.js ├── printSensorValues.js ├── turnOnDevices.js ├── fetch.js ├── tag.js ├── flowcard-run.js └── flowcard-list.js ├── examples ├── global-set.js ├── hello-world.js ├── lodash.js ├── global-get.js ├── wait.js ├── condition.js ├── printSensorValues.js ├── turnOnDevices.js ├── fetch.js ├── tag.js ├── flowcard-run.js └── flowcard-list.js ├── .editorconfig ├── .github └── workflows │ ├── homey-app-validate.yml │ ├── homey-app-publish.yml │ ├── homey-app-translate.yml │ ├── docs.yml │ ├── homey-app-version.yml │ └── lint.yml ├── .eslintrc.js ├── lib ├── Base.js └── flow │ ├── actions │ ├── RunCodeAction.js │ ├── RunAction.js │ ├── RunWithArgAction.js │ ├── RunCodeWithArgAction.js │ ├── RunCodeReturnsNumberAction.js │ ├── RunCodeReturnsStringAction.js │ ├── RunCodeReturnsBooleanAction.js │ ├── RunCodeWithArgReturnsNumberAction.js │ ├── RunCodeWithArgReturnsStringAction.js │ └── RunCodeWithArgReturnsBooleanAction.js │ └── conditions │ ├── RunCondition.js │ ├── RunCodeCondition.js │ ├── RunWithArgCondition.js │ └── RunCodeWithArgCondition.js ├── README.ko.txt ├── README.txt ├── README.no.txt ├── README.da.txt ├── README.sv.txt ├── README.pl.txt ├── README.nl.txt ├── README.de.txt ├── README.ru.txt ├── README.es.txt ├── README.it.txt ├── README.fr.txt ├── .homeycompose ├── flow │ ├── actions │ │ ├── runCode.json │ │ ├── runCode_v2.json │ │ ├── run.json │ │ ├── runCodeReturnsNumber_v2.json │ │ ├── runCodeReturnsBoolean_v2.json │ │ ├── runCodeReturnsString_v2.json │ │ ├── runCodeReturnsBoolean.json │ │ ├── runCodeReturnsNumber.json │ │ ├── runCodeReturnsString.json │ │ ├── runCodeWithArg_v2.json │ │ ├── runCodeWithArg.json │ │ ├── runWithArg.json │ │ ├── runCodeWithArgReturnsBoolean_v2.json │ │ ├── runCodeWithArgReturnsNumber_v2.json │ │ ├── runCodeWithArgReturnsString_v2.json │ │ ├── runCodeWithArgReturnsBoolean.json │ │ ├── runCodeWithArgReturnsNumber.json │ │ └── runCodeWithArgReturnsString.json │ └── conditions │ │ ├── run.json │ │ ├── runCode_v2.json │ │ ├── runCode.json │ │ ├── runCodeWithArg_v2.json │ │ ├── runCodeWithArg.json │ │ └── runWithArg.json └── app.json ├── .homeychangelog.json ├── package.json ├── api.js ├── app.js └── app.json /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 -------------------------------------------------------------------------------- /.homeyignore: -------------------------------------------------------------------------------- 1 | /www -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /build 3 | 4 | # Added by Homey CLI 5 | /.homeybuild/ -------------------------------------------------------------------------------- /docs/tutorials/migrate.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Migrating deprecated scripts" 3 | } -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "printWidth": 100 5 | } 6 | -------------------------------------------------------------------------------- /assets/images/large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/athombv/com.athom.homeyscript/HEAD/assets/images/large.png -------------------------------------------------------------------------------- /assets/images/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/athombv/com.athom.homeyscript/HEAD/assets/images/small.png -------------------------------------------------------------------------------- /assets/images/xlarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/athombv/com.athom.homeyscript/HEAD/assets/images/xlarge.png -------------------------------------------------------------------------------- /examples-v1/global-set.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script sets a global variable. 3 | */ 4 | 5 | global.set('myHomeyScriptVariable', 'Some Value'); -------------------------------------------------------------------------------- /examples/global-set.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script sets a global variable. 3 | */ 4 | 5 | global.set('myHomeyScriptVariable', 'Some Value'); -------------------------------------------------------------------------------- /examples-v1/hello-world.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script gets the Homey's owner, 3 | * and logs "Hello, !" 4 | */ 5 | 6 | const user = await Homey.users.getUserMe(); 7 | log(`Hello, ${user.name}!`); -------------------------------------------------------------------------------- /examples/hello-world.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script gets the Homey's owner, 3 | * and logs "Hello, !" 4 | */ 5 | 6 | const user = await Homey.users.getUserMe(); 7 | log(`Hello, ${user.name}!`); -------------------------------------------------------------------------------- /examples-v1/lodash.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to use lodash. 3 | * Read the docs: https://lodash.com 4 | */ 5 | 6 | const result = _.partition([1, 2, 3, 4], n => n % 2) 7 | log(result); -------------------------------------------------------------------------------- /examples/lodash.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to use lodash. 3 | * Read the docs: https://lodash.com 4 | */ 5 | 6 | const result = _.partition([1, 2, 3, 4], n => n % 2) 7 | log(result); -------------------------------------------------------------------------------- /examples/global-get.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script gets a global variable. 3 | */ 4 | 5 | const value = global.get('myHomeyScriptVariable'); 6 | log('Value:', value); 7 | 8 | const keys = global.keys(); 9 | log('Variables:', keys); -------------------------------------------------------------------------------- /examples-v1/global-get.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script gets a global variable. 3 | */ 4 | 5 | const value = global.get('myHomeyScriptVariable'); 6 | log('Value:', value); 7 | 8 | const keys = global.keys(); 9 | log('Variables:', keys); -------------------------------------------------------------------------------- /examples/wait.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to use wait(). 3 | */ 4 | 5 | log('Time 1:', new Date()); 6 | 7 | // Wait one second (1000 milliseconds) 8 | await wait(1000); 9 | 10 | log('Time 2:', new Date()); -------------------------------------------------------------------------------- /examples-v1/wait.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to use wait(). 3 | */ 4 | 5 | log('Time 1:', new Date()); 6 | 7 | // Wait one second (1000 milliseconds) 8 | await wait(1000); 9 | 10 | log('Time 2:', new Date()); -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | 7 | indent_style = space 8 | indent_size = 2 9 | 10 | trim_trailing_whitespace = true 11 | 12 | max_line_length = 100 13 | insert_final_newline = true 14 | 15 | ij_javascript_use_double_quotes = false 16 | 17 | -------------------------------------------------------------------------------- /examples-v1/say.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script will let Homey say something. 3 | * If a string-type argument is set, it will say the argument. 4 | * Otherwise, it'll say "Hello from HomeyScript!" 5 | */ 6 | 7 | const text = (typeof args[0] === 'string') 8 | ? args[0] 9 | : 'Hello from HomeyScript!'; 10 | 11 | log('Say:', text); 12 | await say(text); -------------------------------------------------------------------------------- /.github/workflows/homey-app-validate.yml: -------------------------------------------------------------------------------- 1 | name: Validate Homey App 2 | on: 3 | workflow_dispatch: 4 | 5 | jobs: 6 | main: 7 | name: Validate Homey App 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: athombv/github-action-homey-app-validate@master 12 | with: 13 | level: verified -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | root: true, 5 | extends: ['eslint:recommended', 'prettier'], 6 | env: { 7 | node: true, 8 | es2023: true, 9 | }, 10 | overrides: [ 11 | { 12 | files: ['*.js', '*.mjs'], 13 | rules: { 14 | 'no-unused-vars': ['warn', { args: 'none' }], 15 | }, 16 | }, 17 | ], 18 | ignorePatterns: ['/examples/**', '/examples-v1/**', 'build'], 19 | }; 20 | -------------------------------------------------------------------------------- /docs/jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "templates": { 3 | "default": { 4 | "outputSourceFiles": false 5 | } 6 | }, 7 | "opts": { 8 | "mainpagetitle": "HomeyScript", 9 | "template": "./node_modules/homey-jsdoc-template", 10 | "simpleAnalyticsHost": "sa.athom.com", 11 | "destination": "./build", 12 | "tutorials": "./docs/tutorials" 13 | }, 14 | "source": { 15 | "include": ["./docs/README.md", "./docs/api.js"] 16 | }, 17 | "plugins": ["plugins/markdown"] 18 | } 19 | -------------------------------------------------------------------------------- /lib/Base.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | class Base { 4 | /** 5 | * @param {Object} options 6 | * @param {import('@types/homey/lib/Homey')} options.homey 7 | */ 8 | constructor({ homey }) { 9 | this.homey = homey; 10 | 11 | this.log = (...args) => { 12 | homey.emit('__log', `[${this.constructor.name}]`, ...args); 13 | }; 14 | 15 | this.error = (...args) => { 16 | homey.emit('__error', `[${this.constructor.name}]`, ...args); 17 | }; 18 | } 19 | } 20 | 21 | module.exports = { Base }; 22 | -------------------------------------------------------------------------------- /README.ko.txt: -------------------------------------------------------------------------------- 1 | HomeyScript와 함께 스크립팅 파워를 해방하세요. Flows로는 부족했던 모든 것을 자동화할 수 있어요! 2 | 3 | HomeyScript는 Homey Web API와 다양한 Homey Apps SDK 기능들과 상호작용하는 JavaScript 기반의 스크립팅 언어입니다. 4 | 5 | 다양한 기능을 사용할 수 있어요: 6 | 7 | — Homey의 장치를 제어하고 모니터링합니다. 8 | — Flow에서 HomeyScript를 시작할 수 있고, Tags도 사용 가능합니다. 9 | — HomeyScript가 'True!'라고 말할 때만 Flow가 계속되게 만듭니다. 10 | — HomeyScript에서 Flow Tags를 만들고 관리합니다. 11 | — HomeyScript 내에서 어떤 웹사이트의 API에도 접근할 수 있습니다. 12 | — Homey가 동적인 텍스트를 말하게 할 수 있습니다. 13 | — 그 외에도 많고 많은 기능들이 있습니다... 14 | 15 | 설치 후, Mac이나 PC에서 https://my.homey.app/script 를 방문하여 스크립팅을 시작하세요. -------------------------------------------------------------------------------- /assets/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples-v1/condition.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script is an example for usage in a Flow with the 3 | * 'Run a script with an argument' in the 'And'-column. 4 | * 5 | * It checks if the argument begins with an "a", 6 | * and returns a boolean. 7 | * 8 | * If this is true, the Flow will continue. 9 | * If it's false, the Flow will stop. 10 | * 11 | * For example: 12 | * "aaa" -> true 13 | * "baa" -> false 14 | */ 15 | 16 | if (typeof args[0] !== 'string') { 17 | throw new Error('This script must be run from a Flow!'); 18 | } 19 | 20 | if (args[0].startsWith('a')) { 21 | return true; 22 | } else { 23 | return false; 24 | } -------------------------------------------------------------------------------- /examples/condition.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script is an example for usage in a Flow with the 3 | * 'Run a script with an argument' in the 'And'-column. 4 | * 5 | * It checks if the argument begins with an "a", 6 | * and returns a boolean. 7 | * 8 | * If this is true, the Flow will continue. 9 | * If it's false, the Flow will stop. 10 | * 11 | * For example: 12 | * "aaa" -> true 13 | * "baa" -> false 14 | */ 15 | 16 | if (typeof args[0] !== 'string') { 17 | throw new Error('This script must be run from a Flow!'); 18 | } 19 | 20 | if (args[0].startsWith('a')) { 21 | return true; 22 | } else { 23 | return false; 24 | } -------------------------------------------------------------------------------- /examples-v1/printSensorValues.js: -------------------------------------------------------------------------------- 1 | /* 2 | * In this script we print all sensor values. 3 | */ 4 | 5 | // Get all devices 6 | const devices = await Homey.devices.getDevices(); 7 | 8 | // Loop over all devices 9 | for (const device of Object.values(devices)) { 10 | 11 | // If this device isn't available, skip it. 12 | if (!device.capabilitiesObj) continue; 13 | 14 | // If this device is a sensor (class) 15 | if (device.class === 'sensor') { 16 | log(`\n=== ${device.name} ===`); 17 | 18 | for (const capability of Object.values(device.capabilitiesObj)) { 19 | log(`${capability.title}: ${capability.value}`); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /examples/printSensorValues.js: -------------------------------------------------------------------------------- 1 | /* 2 | * In this script we print all sensor values. 3 | */ 4 | 5 | // Get all devices 6 | const devices = await Homey.devices.getDevices(); 7 | 8 | // Loop over all devices 9 | for (const device of Object.values(devices)) { 10 | 11 | // If this device isn't available, skip it. 12 | if (!device.capabilitiesObj) continue; 13 | 14 | // If this device is a sensor (class) 15 | if (device.class === 'sensor') { 16 | log(`\n=== ${device.name} ===`); 17 | 18 | for (const capability of Object.values(device.capabilitiesObj)) { 19 | log(`${capability.title}: ${capability.value}`); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /examples/turnOnDevices.js: -------------------------------------------------------------------------------- 1 | /* 2 | * In this script we turn on all lights. 3 | */ 4 | 5 | // Get all devices 6 | const devices = await Homey.devices.getDevices(); 7 | 8 | // Loop over all devices 9 | for (const device of Object.values(devices)) { 10 | 11 | // If this device is a light (class) 12 | // Or this is a 'What's plugged in?'-light (virtualClass) 13 | if (device.class === 'light' || device.virtualClass === 'light') { 14 | log(`\nTurning '${device.name}' on...`); 15 | 16 | // Turn the light on by setting the capability `onoff` to `true` 17 | await device.setCapabilityValue('onoff', true) 18 | .then(() => log('OK')) 19 | .catch(error => log(`Error:`, error)); 20 | } 21 | } -------------------------------------------------------------------------------- /examples-v1/turnOnDevices.js: -------------------------------------------------------------------------------- 1 | /* 2 | * In this script we turn on all lights. 3 | */ 4 | 5 | // Get all devices 6 | const devices = await Homey.devices.getDevices(); 7 | 8 | // Loop over all devices 9 | for (const device of Object.values(devices)) { 10 | 11 | // If this device is a light (class) 12 | // Or this is a 'What's plugged in?'-light (virtualClass) 13 | if (device.class === 'light' || device.virtualClass === 'light') { 14 | log(`\nTurning '${device.name}' on...`); 15 | 16 | // Turn the light on by setting the capability `onoff` to `true` 17 | await device.setCapabilityValue('onoff', true) 18 | .then(() => log('OK')) 19 | .catch(error => log(`Error:`, error)); 20 | } 21 | } -------------------------------------------------------------------------------- /examples-v1/fetch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to get some 3 | * information from the internet using fetch(). 4 | * 5 | * In this example, we get the HomeyScript app from the Homey App Store API, 6 | * and show the app's rating using emoji. 7 | */ 8 | 9 | // Create the request 10 | const res = await fetch('https://apps-api.athom.com/api/v1/app/com.athom.homeyscript'); 11 | if (!res.ok) { 12 | throw new Error(res.statusText); 13 | } 14 | 15 | // Get the body JSON 16 | const body = await res.json(); 17 | 18 | log(`${body.liveBuild.name.en} (${body.id}) v${body.liveVersion}`); 19 | 20 | // Print rating 21 | const stars = Array(Math.round(body.rating)) 22 | .fill('⭐️') 23 | .join(''); 24 | 25 | log(`Rating: ${stars}`); -------------------------------------------------------------------------------- /examples-v1/tag.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script will create a few Tags for use in Flow. 3 | * It will remove them after 5 seconds. 4 | */ 5 | 6 | // Create Tags 7 | log('Creating My String...'); 8 | await tag('My String', 'abcdef'); 9 | 10 | log('Creating My Number...'); 11 | await tag('My Number', 123); 12 | 13 | log('Creating My Boolean...'); 14 | await tag('My Boolean', true); 15 | 16 | // Wait 5s 17 | for (let i = 0; i < 5; i++) { 18 | log('.'); 19 | await wait(1000); // in milliseconds 20 | } 21 | 22 | // Delete Tags 23 | log('Deleting My String...'); 24 | await tag('My String', null); 25 | 26 | log('Deleting My Number...'); 27 | await tag('My Number', null); 28 | 29 | log('Deleting My Boolean...'); 30 | await tag('My Boolean', null); -------------------------------------------------------------------------------- /examples/fetch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to get some 3 | * information from the internet using fetch(). 4 | * 5 | * In this example, we get the HomeyScript app from the Homey App Store API, 6 | * and show the app's rating using emoji. 7 | */ 8 | 9 | // Create the request 10 | const res = await fetch('https://apps-api.athom.com/api/v1/app/com.athom.homeyscript'); 11 | if (!res.ok) { 12 | throw new Error(res.statusText); 13 | } 14 | 15 | // Get the body JSON 16 | const body = await res.json(); 17 | 18 | log(`${body.liveBuild.name.en} (${body.id}) v${body.liveVersion}`); 19 | 20 | // Print rating 21 | const stars = Array(Math.round(body.rating)) 22 | .fill('⭐️') 23 | .join(''); 24 | 25 | log(`Rating: ${stars}`); -------------------------------------------------------------------------------- /examples/tag.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script will create a few Tags for use in Flow. 3 | * It will remove them after 5 seconds. 4 | */ 5 | 6 | // Create Tags 7 | log('Creating My String...'); 8 | await tag('My String', 'abcdef'); 9 | 10 | log('Creating My Number...'); 11 | await tag('My Number', 123); 12 | 13 | log('Creating My Boolean...'); 14 | await tag('My Boolean', true); 15 | 16 | // Wait 5s 17 | for (let i = 0; i < 5; i++) { 18 | log('.'); 19 | await wait(1000); // in milliseconds 20 | } 21 | 22 | // Delete Tags 23 | log('Deleting My String...'); 24 | await tag('My String', null); 25 | 26 | log('Deleting My Number...'); 27 | await tag('My Number', null); 28 | 29 | log('Deleting My Boolean...'); 30 | await tag('My Boolean', null); -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Unleash the scripting power with HomeyScript. Automate everything you ever dreamed of, even when Flows are not enough for you! 2 | 3 | HomeyScript is a JavaScript-based scripting language that interacts with the Homey Web API and various Homey Apps SDK functions. 4 | 5 | Among many things, you can: 6 | 7 | — Control & Monitor your Homey's devices. 8 | — Start a HomeyScript from a Flow, even with Tags. 9 | — Make a Flow only continue when your HomeyScript says 'True!' 10 | — Create & Manage Flow Tags from a HomeyScript. 11 | — Access any website's API from within a HomeyScript. 12 | — Let Homey say dynamic text. 13 | — And much, much more... 14 | 15 | After installation, visit https://my.homey.app/script on your Mac or PC to start scripting. 16 | -------------------------------------------------------------------------------- /README.no.txt: -------------------------------------------------------------------------------- 1 | Slipp løs kraften av skripting med HomeyScript. Automatiser alt du noen gang har drømt om, selv når Flows ikke er nok for deg! 2 | 3 | HomeyScript er et JavaScript-basert skriptspråk som interagerer med Homey Web API og ulike Homey Apps SDK-funksjoner. 4 | 5 | Blant annet kan du: 6 | 7 | — Kontrollere og overvåke Homey's enheter. 8 | — Starte et HomeyScript fra en Flow, selv med Tags. 9 | — Få en Flow til å fortsette bare når ditt HomeyScript sier 'True!' 10 | — Opprette og administrere Flow Tags fra et HomeyScript. 11 | — Få tilgang til API-er fra alle nettsider innenfor et HomeyScript. 12 | — La Homey si dynamisk tekst. 13 | — Og mye, mye mer... 14 | 15 | Etter installasjon, besøk https://my.homey.app/script på din Mac eller PC for å begynne å skripte. -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # HomeyScript 2 | 3 | > "The best thing since sliced bread!" 4 | 5 | Unleash the scripting power with HomeyScript. Automate everything you every dreamed of, even when Flows are not enough for you! 6 | 7 | HomeyScript is a JavaScript-based scripting language that interacts with the Homey Web API and various Homey Apps SDK functions. 8 | 9 | ## 🚀 Usage 10 | 11 | 1. Install HomeyScript from [https://homey.app/a/com.athom.homeyscript](https://homey.app/a/com.athom.homeyscript) 12 | 2. Visit [https://my.homey.app/scripts](https://my.homey.app/scripts) 13 | 3. Script as you please! 14 | 15 | ## 📚 Documentation 16 | 17 | Visit the [HomeyScript Reference](https://athombv.github.io/com.athom.homeyscript/global.html) to learn what you can do in a HomeyScript. 18 | -------------------------------------------------------------------------------- /README.da.txt: -------------------------------------------------------------------------------- 1 | Slip kræfterne løs med HomeyScript. Automatiser alt, hvad du nogensinde har drømt om, selv når Flows ikke er nok for dig! 2 | 3 | HomeyScript er et JavaScript-baseret scriptsprog, der interagerer med Homey Web API'et og forskellige Homey Apps SDK-funktioner. 4 | 5 | Blandt mange ting kan du: 6 | 7 | — Kontrollere og overvåge dine Homey-enheder. 8 | — Starte et HomeyScript fra et Flow, selv med Tags. 9 | — Få et Flow til kun at fortsætte, når dit HomeyScript siger 'True!' 10 | — Oprette og administrere Flow Tags fra et HomeyScript. 11 | — Tilgå enhver hjemmesides API fra et HomeyScript. 12 | — Lade Homey sige dynamisk tekst. 13 | — Og meget, meget mere... 14 | 15 | Efter installationen, besøg https://my.homey.app/script på din Mac eller PC for at starte scripting. -------------------------------------------------------------------------------- /README.sv.txt: -------------------------------------------------------------------------------- 1 | Släpp lös skriptkraften med HomeyScript. Automatisera allt du någonsin drömt om, även när Flow inte räcker till för dig! 2 | 3 | HomeyScript är ett JavaScript-baserat skriptspråk som interagerar med Homey Web API och olika Homey Apps SDK-funktioner. 4 | 5 | Bland annat kan du: 6 | 7 | — Kontrollera & övervaka dina Homey-enheter. 8 | — Starta ett HomeyScript från ett Flow, även med Taggar. 9 | — Få ett Flow att bara fortsätta när ditt HomeyScript säger 'True!' 10 | — Skapa & hantera Flow Taggar från ett HomeyScript. 11 | — Få åtkomst till vilken webbplats API som helst från ett HomeyScript. 12 | — Låt Homey säga dynamisk text. 13 | — Och mycket, mycket mer... 14 | 15 | Efter installation, besök https://my.homey.app/script på din Mac eller PC för att börja skirpta. -------------------------------------------------------------------------------- /examples/flowcard-run.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to run an 'And' Flow Card, 3 | * and how to run an 'Then' Flow Card. 4 | */ 5 | 6 | // Run 'Day Equals' Flow 'And' Card 7 | const { result: isWeekend } = await Homey.flow.runFlowCardCondition({ 8 | id: 'homey:manager:cron:day_equals', 9 | args: { 10 | day: 'weekend', 11 | }, 12 | }); 13 | 14 | log('Is Weekend:', isWeekend); 15 | 16 | // Run 'Show Animation' Flow 'Then' Card 17 | // This will pulse Green (#00FF00) when it's a weekend 18 | // or pulse Red (#FF0000) when it's a weekday 19 | await Homey.flow.runFlowCardAction({ 20 | id: 'homey:manager:ledring:animate_pulse', 21 | args: { 22 | animation: 'pulse', 23 | color: isWeekend 24 | ? '#00FF00' 25 | : '#FF0000', 26 | }, 27 | }); -------------------------------------------------------------------------------- /examples-v1/flowcard-run.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script demonstrates how to run an 'And' Flow Card, 3 | * and how to run an 'Then' Flow Card. 4 | */ 5 | 6 | // Run 'Day Equals' Flow 'And' Card 7 | const { result: isWeekend } = await Homey.flow.runFlowCardCondition({ 8 | id: 'homey:manager:cron:day_equals', 9 | args: { 10 | day: 'weekend', 11 | }, 12 | }); 13 | 14 | log('Is Weekend:', isWeekend); 15 | 16 | // Run 'Show Animation' Flow 'Then' Card 17 | // This will pulse Green (#00FF00) when it's a weekend 18 | // or pulse Red (#FF0000) when it's a weekday 19 | await Homey.flow.runFlowCardAction({ 20 | id: 'homey:manager:ledring:show_animation', 21 | args: { 22 | animation: 'pulse', 23 | color: isWeekend 24 | ? '#00FF00' 25 | : '#FF0000', 26 | }, 27 | }); -------------------------------------------------------------------------------- /README.pl.txt: -------------------------------------------------------------------------------- 1 | Uwolnij moc skryptowania z HomeyScript. Automatyzuj wszystko, o czym kiedykolwiek marzyłeś, nawet jeśli Flows nie są dla Ciebie wystarczające! 2 | 3 | HomeyScript to oparty na JavaScript język skryptowy, który współpracuje z Homey Web API i różnymi funkcjami Homey Apps SDK. 4 | 5 | Między innymi, możesz: 6 | 7 | — Kontrolować i monitorować urządzenia Homey. 8 | — Uruchomić HomeyScript z Flow, nawet z Tagami. 9 | — Sprawić, że Flow będzie kontynuowane tylko wtedy, gdy HomeyScript powie 'True!' 10 | — Tworzyć i zarządzać Tagami Flow z HomeyScript. 11 | — Uzyskać dostęp do API dowolnej strony internetowej z HomeyScript. 12 | — Sprawić, by Homey mówił dynamiczny tekst. 13 | — I wiele, wiele więcej... 14 | 15 | Po instalacji, odwiedź https://my.homey.app/script na swoim Macu lub PC, aby rozpocząć skryptowanie. -------------------------------------------------------------------------------- /README.nl.txt: -------------------------------------------------------------------------------- 1 | Ontketen de kracht van scripten met HomeyScript. Automatiseer alles waar je ooit van hebt gedroomd, zelfs als Flows niet genoeg voor je zijn! 2 | 3 | HomeyScript is een op JavaScript gebaseerde scripttaal die interactie heeft met de Homey Web API en verschillende Homey Apps SDK functies. 4 | 5 | Onder veel andere dingen, kun je: 6 | 7 | — Je Homey apparaten beheren en monitoren. 8 | — Een HomeyScript starten vanuit een Flow, zelfs met Tags. 9 | — Een Flow alleen laten doorgaan wanneer je HomeyScript 'True!' zegt. 10 | — Flow Tags creëren en beheren vanuit een HomeyScript. 11 | — Toegang krijgen tot elke website API vanuit een HomeyScript. 12 | — Homey dynamische tekst laten zeggen. 13 | — En nog veel, veel meer... 14 | 15 | Na installatie, bezoek https://my.homey.app/script op je Mac of PC om te beginnen met scripten. -------------------------------------------------------------------------------- /README.de.txt: -------------------------------------------------------------------------------- 1 | Entfessle die Skriptfähigkeiten mit HomeyScript. Automatisiere alles, was du dir je erträumt hast, selbst wenn Flows nicht ausreichen! 2 | 3 | HomeyScript ist eine auf JavaScript basierende Skriptsprache, die mit der Homey Web API und verschiedenen Funktionen des Homey Apps SDK interagiert. 4 | 5 | Du kannst unter anderem: 6 | 7 | — Deine Homey-Geräte steuern & überwachen. 8 | — Ein HomeyScript aus einem Flow starten, sogar mit Tags. 9 | — Einen Flow nur fortsetzen, wenn dein HomeyScript 'True!' sagt. 10 | — Flow Tags aus einem HomeyScript erstellen & verwalten. 11 | — Auf die API jeder Website aus einem HomeyScript zugreifen. 12 | — Homey dynamischen Text sagen lassen. 13 | — Und vieles, vieles mehr... 14 | 15 | Nach der Installation besuche https://my.homey.app/script auf deinem Mac oder PC, um mit dem Skripten zu beginnen. -------------------------------------------------------------------------------- /README.ru.txt: -------------------------------------------------------------------------------- 1 | Открой возможности скриптинга с HomeyScript. Автоматизируйте всё, о чём вы когда-либо мечтали, даже когда Flows вам не хватает! 2 | 3 | HomeyScript - это язык скриптов на основе JavaScript, который взаимодействует с Homey Web API и различными функциями SDK Homey Apps. 4 | 5 | Среди множества возможностей, вы можете: 6 | 7 | — Управлять и контролировать устройства вашего Homey. 8 | — Запускать HomeyScript из Flow, даже с использованием тегов. 9 | — Продолжать Flow только тогда, когда ваш HomeyScript скажет 'True!' 10 | — Создавать и управлять тегами Flow с помощью HomeyScript. 11 | — Доступ к любому API веб-сайта из HomeyScript. 12 | — Заставить Homey произносить динамический текст. 13 | — И многое, многое другое... 14 | 15 | После установки, зайдите на https://my.homey.app/script на вашем Mac или ПК, чтобы начать скриптинг. -------------------------------------------------------------------------------- /README.es.txt: -------------------------------------------------------------------------------- 1 | Desata el poder del scripting con HomeyScript. ¡Automatiza todo lo que siempre soñaste, incluso cuando los Flows no son suficientes para ti! 2 | 3 | HomeyScript es un lenguaje de scripting basado en JavaScript que interactúa con el Homey Web API y varias funciones del SDK de las Apps de Homey. 4 | 5 | Entre muchas cosas, puedes: 6 | 7 | — Controlar y monitorear los dispositivos de tu Homey. 8 | — Iniciar un HomeyScript desde un Flow, incluso con Tags. 9 | — Hacer que un Flow solo continúe cuando tu HomeyScript diga ‘¡Verdadero!’ 10 | — Crear y gestionar Tags de Flow desde un HomeyScript. 11 | — Acceder a la API de cualquier sitio web desde un HomeyScript. 12 | — Hacer que Homey diga texto dinámico. 13 | — Y mucho, mucho más... 14 | 15 | Después de la instalación, visita https://my.homey.app/script en tu Mac o PC para empezar a hacer scripting. -------------------------------------------------------------------------------- /.github/workflows/homey-app-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Homey App 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | publish-app: 8 | name: Publish App 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | 13 | - uses: webfactory/ssh-agent@v0.9.0 14 | env: 15 | SSH_KEY: ${{ secrets.SSH_KEY }} 16 | if: env.SSH_KEY != null 17 | with: 18 | ssh-private-key: ${{ env.SSH_KEY }} 19 | 20 | - name: Publish 21 | uses: athombv/github-action-homey-app-publish@master 22 | id: publish 23 | with: 24 | personal_access_token: ${{ secrets.HOMEY_PAT }} 25 | 26 | - name: URL 27 | run: | 28 | echo "Manage your app at ${{ steps.publish.outputs.url }}." >> $GITHUB_STEP_SUMMARY 29 | -------------------------------------------------------------------------------- /README.it.txt: -------------------------------------------------------------------------------- 1 | Scopri tutto il potere della programmazione con HomeyScript. Automotizza qualsiasi cosa tu possa immaginare, anche quando i Flows non sono sufficienti! 2 | 3 | HomeyScript è un linguaggio di scripting basato su JavaScript che interagisce con l'API Web di Homey e varie funzioni dell'SDK delle App di Homey. 4 | 5 | Tra le tante cose, puoi: 6 | 7 | — Controllare e monitorare i dispositivi del tuo Homey. 8 | — Avviare un HomeyScript da un Flow, anche con i Tag. 9 | — Far continuare un Flow solo quando il tuo HomeyScript dice 'True!' 10 | — Creare e gestire i Tag dei Flows da un HomeyScript. 11 | — Accedere all'API di qualsiasi sito web direttamente da un HomeyScript. 12 | — Far dire a Homey del testo dinamico. 13 | — E molto, molto altro ancora... 14 | 15 | Dopo l'installazione, visita https://my.homey.app/script sul tuo Mac o PC per iniziare a programmare. -------------------------------------------------------------------------------- /README.fr.txt: -------------------------------------------------------------------------------- 1 | Libérez la puissance du script avec HomeyScript. Automatisez tout ce dont vous avez toujours rêvé, même lorsque les Flows ne suffisent pas ! 2 | 3 | HomeyScript est un langage de script basé sur JavaScript qui interagit avec l'API Web de Homey et diverses fonctions SDK des applications Homey. 4 | 5 | Parmi de nombreuses choses, vous pouvez : 6 | 7 | — Contrôler & Surveiller les appareils de votre Homey. 8 | — Lancer un HomeyScript depuis un Flow, même avec des Tags. 9 | — Faire en sorte qu'un Flow continue seulement lorsque votre HomeyScript dit 'True!' 10 | — Créer & Gérer des Tags de Flow à partir d'un HomeyScript. 11 | — Accéder à l'API de n'importe quel site web depuis un HomeyScript. 12 | — Faire dire à Homey un texte dynamique. 13 | — Et bien plus encore... 14 | 15 | Après l'installation, rendez-vous sur https://my.homey.app/script sur votre Mac ou PC pour commencer à scripter. -------------------------------------------------------------------------------- /.github/workflows/homey-app-translate.yml: -------------------------------------------------------------------------------- 1 | name: Translate Homey App 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | main: 8 | name: Translate App 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | 13 | - name: Translate Homey App 14 | uses: athombv/github-action-homey-app-translate@master 15 | with: 16 | openai_api_key: ${{ secrets.OPENAI_API_KEY }} 17 | 18 | - name: Commit, Push & Create Pull Request 19 | env: 20 | GH_TOKEN: ${{ github.token }} 21 | run: | 22 | git config --local user.email "sysadmin+githubactions@athom.com" 23 | git config --local user.name "Homey Github Actions Bot" 24 | 25 | git checkout -b feature/openai-translations 26 | 27 | git add -A 28 | git commit -m "Automatic translations with OpenAI" 29 | git push --set-upstream origin feature/openai-translations 30 | 31 | gh pr create --fill -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow.getActionCard('runCode').registerRunListener(async ({ code }, state) => { 14 | await this.homey.app.runScript({ 15 | id: '__temporary__', 16 | name: 'Test', 17 | code, 18 | args: [], 19 | realtime: state.realtime != null ? state.realtime : false, 20 | version: 1, 21 | }); 22 | }); 23 | 24 | this.homey.flow.getActionCard('runCode_v2').registerRunListener(async ({ code }, state) => { 25 | await this.homey.app.runScript({ 26 | id: '__temporary__', 27 | name: 'Test', 28 | code, 29 | args: [], 30 | realtime: state.realtime != null ? state.realtime : false, 31 | version: 2, 32 | }); 33 | }); 34 | } 35 | } 36 | 37 | module.exports = { RunCodeAction }; 38 | -------------------------------------------------------------------------------- /examples/flowcard-list.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script lists all 'And' and 'Then'-cards, 3 | * so you know how to use them in HomeyScript 4 | * by calling Homey.flow.runFlowCardCondition() 5 | * and Homey.flow.runFlowCardAction() 6 | * 7 | * Also see: example-flowcard-run.js 8 | */ 9 | 10 | log('==========='); 11 | log('And-cards:'); 12 | log('==========='); 13 | const conditionCards = await Homey.flow.getFlowCardConditions(); 14 | for( const card of Object.values(conditionCards) ) { 15 | log(card.titleFormatted || card.title) 16 | log(JSON.stringify({ 17 | id: card.id, 18 | args: card.args, 19 | droptoken: card.droptoken, 20 | duration: card.duration, 21 | }, false, 2)); 22 | log('-----------') 23 | } 24 | 25 | log('==========='); 26 | log('Then-cards:'); 27 | log('==========='); 28 | const actionCards = await Homey.flow.getFlowCardActions(); 29 | for( const card of Object.values(actionCards) ) { 30 | log(card.titleFormatted || card.title) 31 | log(JSON.stringify({ 32 | id: card.id, 33 | args: card.args, 34 | droptoken: card.droptoken, 35 | duration: card.duration, 36 | }, false, 2)); 37 | log('-----------') 38 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCode.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]]", 19 | "nl": "Voer [[code]] uit", 20 | "da": "Kør [[code]]", 21 | "de": "Führen Sie [[code]] aus", 22 | "es": "Ejecutar [[code]]", 23 | "fr": "Exécuter [[code]]", 24 | "it": "Esegui [[code]]", 25 | "no": "Kjør [[code]]", 26 | "sv": "Kör [[code]]", 27 | "pl": "Uruchom [[code]]", 28 | "ru": "Запустить [[code]]", 29 | "ko": "[[code]] 실행" 30 | }, 31 | "advanced": true, 32 | "args": [ 33 | { 34 | "name": "code", 35 | "type": "code", 36 | "language": "homeyscript", 37 | "title": { 38 | "en": "Code", 39 | "nl": "Code" 40 | }, 41 | "value": "// My Code" 42 | } 43 | ] 44 | } -------------------------------------------------------------------------------- /examples-v1/flowcard-list.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script lists all 'And' and 'Then'-cards, 3 | * so you know how to use them in HomeyScript 4 | * by calling Homey.flow.runFlowCardCondition() 5 | * and Homey.flow.runFlowCardAction() 6 | * 7 | * Also see: example-flowcard-run.js 8 | */ 9 | 10 | log('==========='); 11 | log('And-cards:'); 12 | log('==========='); 13 | const conditionCards = await Homey.flow.getFlowCardConditions(); 14 | for( const card of Object.values(conditionCards) ) { 15 | log(card.titleFormatted || card.title) 16 | log(JSON.stringify({ 17 | id: card.id, 18 | args: card.args, 19 | droptoken: card.droptoken, 20 | duration: card.duration, 21 | }, false, 2)); 22 | log('-----------') 23 | } 24 | 25 | log('==========='); 26 | log('Then-cards:'); 27 | log('==========='); 28 | const actionCards = await Homey.flow.getFlowCardActions(); 29 | for( const card of Object.values(actionCards) ) { 30 | log(card.titleFormatted || card.title) 31 | log(JSON.stringify({ 32 | id: card.id, 33 | args: card.args, 34 | droptoken: card.droptoken, 35 | duration: card.duration, 36 | }, false, 2)); 37 | log('-----------') 38 | } -------------------------------------------------------------------------------- /lib/flow/actions/RunAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow.getActionCard('run') 14 | .registerRunListener(async ({ script }) => { 15 | const scriptSource = await this.homey.app.getScript({ id: script.id }); 16 | 17 | return this.homey.app.runScript({ 18 | id: scriptSource.id, 19 | name: scriptSource.name, 20 | code: scriptSource.code, 21 | lastExecuted: scriptSource.lastExecuted, 22 | version: scriptSource.version, 23 | realtime: false, 24 | }).finally(() => { 25 | this.homey.app.updateScript({ 26 | id: scriptSource.id, 27 | lastExecuted: new Date(), 28 | }).catch(this.error); 29 | }); 30 | }) 31 | .registerArgumentAutocompleteListener('script', query => this.homey.app.onFlowGetScriptAutocomplete(query)); 32 | } 33 | } 34 | 35 | module.exports = { RunAction }; 36 | -------------------------------------------------------------------------------- /lib/flow/conditions/RunCondition.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCondition extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow.getConditionCard('run') 14 | .registerRunListener(async ({ script }) => { 15 | const scriptSource = await this.homey.app.getScript({ id: script.id }); 16 | 17 | return this.homey.app.runScript({ 18 | id: scriptSource.id, 19 | name: scriptSource.name, 20 | code: scriptSource.code, 21 | lastExecuted: scriptSource.lastExecuted, 22 | version: scriptSource.version, 23 | realtime: false, 24 | }).finally(() => { 25 | this.homey.app.updateScript({ 26 | id: scriptSource.id, 27 | lastExecuted: new Date(), 28 | }).catch(this.error); 29 | }); 30 | }) 31 | .registerArgumentAutocompleteListener('script', query => this.homey.app.onFlowGetScriptAutocomplete(query)); 32 | } 33 | } 34 | 35 | module.exports = { RunCondition }; 36 | -------------------------------------------------------------------------------- /lib/flow/actions/RunWithArgAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunWithArgAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow.getActionCard('runWithArg') 14 | .registerRunListener(async ({ script, argument }) => { 15 | const scriptSource = await this.homey.app.getScript({ id: script.id }); 16 | 17 | return this.homey.app.runScript({ 18 | id: scriptSource.id, 19 | name: scriptSource.name, 20 | code: scriptSource.code, 21 | lastExecuted: scriptSource.lastExecuted, 22 | version: scriptSource.version, 23 | args: [argument], 24 | realtime: false, 25 | }).finally(() => { 26 | this.homey.app.updateScript({ 27 | id: scriptSource.id, 28 | lastExecuted: new Date(), 29 | }).catch(this.error); 30 | }); 31 | }) 32 | .registerArgumentAutocompleteListener('script', query => this.homey.app.onFlowGetScriptAutocomplete(query)); 33 | } 34 | } 35 | 36 | module.exports = { RunWithArgAction }; 37 | -------------------------------------------------------------------------------- /lib/flow/conditions/RunCodeCondition.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeCondition extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow.getConditionCard('runCode').registerRunListener(async ({ code }, state) => { 14 | return Boolean( 15 | await this.homey.app.runScript({ 16 | id: '__temporary__', 17 | name: 'Test', 18 | code, 19 | args: [], 20 | realtime: state.realtime != null ? state.realtime : false, 21 | version: 1, 22 | }), 23 | ); 24 | }); 25 | 26 | this.homey.flow.getConditionCard('runCode_v2').registerRunListener(async ({ code }, state) => { 27 | return Boolean( 28 | await this.homey.app.runScript({ 29 | id: '__temporary__', 30 | name: 'Test', 31 | code, 32 | args: [], 33 | realtime: state.realtime != null ? state.realtime : false, 34 | version: 2, 35 | }), 36 | ); 37 | }); 38 | } 39 | } 40 | 41 | module.exports = { RunCodeCondition }; 42 | -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeWithArgAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeWithArgAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeWithArg') 15 | .registerRunListener(async ({ code, argument }, state) => { 16 | await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [argument], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | }); 25 | 26 | this.homey.flow 27 | .getActionCard('runCodeWithArg_v2') 28 | .registerRunListener(async ({ code, argument }, state) => { 29 | await this.homey.app.runScript({ 30 | id: '__temporary__', 31 | name: 'Test', 32 | code, 33 | args: [argument], 34 | realtime: state.realtime != null ? state.realtime : false, 35 | version: 2, 36 | }); 37 | }); 38 | } 39 | } 40 | 41 | module.exports = { RunCodeWithArgAction }; 42 | -------------------------------------------------------------------------------- /lib/flow/conditions/RunWithArgCondition.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunWithArgCondition extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow.getConditionCard('runWithArg') 14 | .registerRunListener(async ({ script, argument }) => { 15 | const scriptSource = await this.homey.app.getScript({ id: script.id }); 16 | 17 | return this.homey.app.runScript({ 18 | id: scriptSource.id, 19 | name: scriptSource.name, 20 | code: scriptSource.code, 21 | lastExecuted: scriptSource.lastExecuted, 22 | version: scriptSource.version, 23 | args: [argument], 24 | realtime: false, 25 | }).finally(() => { 26 | this.homey.app.updateScript({ 27 | id: scriptSource.id, 28 | lastExecuted: new Date(), 29 | }).catch(this.error); 30 | }); 31 | }) 32 | .registerArgumentAutocompleteListener('script', query => this.homey.app.onFlowGetScriptAutocomplete(query)); 33 | } 34 | } 35 | 36 | module.exports = { RunWithArgCondition }; 37 | -------------------------------------------------------------------------------- /.homeychangelog.json: -------------------------------------------------------------------------------- 1 | { 2 | "3.1.0": { 3 | "en": "Save & Test -> Test" 4 | }, 5 | "3.1.1": { 6 | "en": "Updated Homey API" 7 | }, 8 | "3.2.0": { 9 | "en": "Added support for starting Flow Cards." 10 | }, 11 | "3.2.1": { 12 | "en": "Small improvements." 13 | }, 14 | "3.2.2": { 15 | "en": "Updated examples." 16 | }, 17 | "3.2.3": { 18 | "en": "Provide option to override fetch agent. Better syntax error display." 19 | }, 20 | "3.2.4": { 21 | "en": "fix typo, add Flow argument title's" 22 | }, 23 | "3.2.5": { 24 | "en": "fix typo, add Flow argument title's" 25 | }, 26 | "3.2.6": { 27 | "en": "Added `Buffer` to global scope." 28 | }, 29 | "3.3.0": { 30 | "en": "Added option to rename scripts" 31 | }, 32 | "3.3.1": { 33 | "en": "use name instead of id in Flow argument" 34 | }, 35 | "3.3.2": { 36 | "en": "Add back Buffer to global scope" 37 | }, 38 | "3.4.0": { 39 | "en": "Add cards for Advanced Flow" 40 | }, 41 | "3.4.1": { 42 | "en": "Upgrade Homey API" 43 | }, 44 | "3.4.2": { 45 | "en": "Improve error handling" 46 | }, 47 | "3.5.0": { 48 | "en": "New scripts now use the new Homey API" 49 | }, 50 | "3.5.1": { 51 | "en": "Update homey-api" 52 | }, 53 | "3.6.0": { 54 | "en": "Added translations." 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Documentation To GitHub Pages 2 | 3 | # v1.0.0 4 | # 5 | # This workflow runs `npm run build` and then syncs the `build` folder to GitHub Pages. 6 | 7 | on: 8 | push: 9 | branches: [ production ] 10 | 11 | jobs: 12 | deploy: 13 | name: Build & Deploy 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - uses: webfactory/ssh-agent@v0.9.0 19 | env: 20 | SSH_KEY: ${{ secrets.SSH_KEY }} 21 | if: env.SSH_KEY != null 22 | with: 23 | ssh-private-key: ${{ env.SSH_KEY }} 24 | 25 | # Setup 26 | - name: Setup Node.js 27 | uses: actions/setup-node@v4 28 | with: 29 | node-version-file: '.nvmrc' 30 | registry-url: 'https://npm.pkg.github.com' 31 | 32 | - name: Install modules 33 | run: npm clean-install --audit=false 34 | env: 35 | GITHUB_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }} 36 | 37 | # Build 38 | - name: Build 39 | run: npm run build 40 | 41 | # Deploy 42 | - name: Deploy To GitHub Pages 43 | uses: peaceiris/actions-gh-pages@v3.8.0 44 | with: 45 | personal_token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }} 46 | publish_dir: ./build -------------------------------------------------------------------------------- /.github/workflows/homey-app-version.yml: -------------------------------------------------------------------------------- 1 | name: Update Homey App Version 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | type: choice 8 | description: Version 9 | required: true 10 | default: patch 11 | options: 12 | - major 13 | - minor 14 | - patch 15 | changelog: 16 | type: string 17 | description: Changelog 18 | required: true 19 | 20 | 21 | jobs: 22 | main: 23 | name: Update App Version 24 | runs-on: ubuntu-latest 25 | steps: 26 | 27 | - uses: actions/checkout@v3 28 | 29 | - name: Update App Version 30 | uses: athombv/github-action-homey-app-version@master 31 | id: update_app_version 32 | with: 33 | version: ${{ github.event.inputs.version }} 34 | changelog: ${{ github.event.inputs.changelog }} 35 | 36 | - name: Commit & Push 37 | run: | 38 | git config --local user.email "sysadmin+githubactions@athom.com" 39 | git config --local user.name "Homey Github Actions Bot" 40 | 41 | git add -A 42 | git commit -m "Update Homey App Version to v${{ steps.update_app_version.outputs.version }}" 43 | git tag "v${{ steps.update_app_version.outputs.version }}" 44 | 45 | git push origin HEAD --tags -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCode_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Выполнить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]]", 18 | "nl": "Voer [[code]] uit", 19 | "da": "Kør [[code]]", 20 | "de": "Führe [[code]] aus", 21 | "es": "Ejecuta [[code]]", 22 | "fr": "Exécute [[code]]", 23 | "it": "Esegui [[code]]", 24 | "no": "Kjør [[code]]", 25 | "sv": "Kör [[code]]", 26 | "pl": "Uruchom [[code]]", 27 | "ru": "Выполнить [[code]]", 28 | "ko": "[[code]] 실행" 29 | }, 30 | "advanced": true, 31 | "args": [ 32 | { 33 | "name": "code", 34 | "type": "code", 35 | "language": "homeyscript", 36 | "title": { 37 | "en": "Code", 38 | "nl": "Code", 39 | "da": "Kode", 40 | "de": "Code", 41 | "es": "Código", 42 | "fr": "Code", 43 | "it": "Codice", 44 | "no": "Kode", 45 | "sv": "Kod", 46 | "pl": "Kod", 47 | "ru": "Код", 48 | "ko": "코드" 49 | }, 50 | "value": "// My Code" 51 | } 52 | ] 53 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/run.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run a script", 4 | "nl": "Voer een script uit", 5 | "da": "Kør et script", 6 | "de": "Ein Skript ausführen", 7 | "es": "Ejecutar un script", 8 | "fr": "Exécuter un script", 9 | "it": "Esegui uno script", 10 | "no": "Kjør et skript", 11 | "sv": "Kör ett skript", 12 | "pl": "Uruchom skrypt", 13 | "ru": "Выполнить скрипт", 14 | "ko": "스크립트 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[script]]", 18 | "nl": "Voer [[script]] uit", 19 | "da": "Kør [[script]]", 20 | "de": "Führe [[script]] aus", 21 | "es": "Ejecutar [[script]]", 22 | "fr": "Exécutez [[script]]", 23 | "it": "Esegui [[script]]", 24 | "no": "Kjør [[script]]", 25 | "sv": "Kör [[script]]", 26 | "pl": "Uruchom [[script]]", 27 | "ru": "Выполнить [[script]]", 28 | "ko": "[[script]] 실행" 29 | }, 30 | "args": [ 31 | { 32 | "name": "script", 33 | "type": "autocomplete", 34 | "title": { 35 | "en": "Script", 36 | "nl": "Script", 37 | "da": "Script", 38 | "de": "Skript", 39 | "es": "Script", 40 | "fr": "Script", 41 | "it": "Script", 42 | "no": "Script", 43 | "sv": "Script", 44 | "pl": "Skrypt", 45 | "ru": "Скрипт", 46 | "ko": "스크립트" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /.homeycompose/flow/conditions/run.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run a script", 4 | "nl": "Voer een script uit", 5 | "da": "Kør et script", 6 | "de": "Ein Skript ausführen", 7 | "es": "Ejecutar un script", 8 | "fr": "Exécuter un script", 9 | "it": "Esegui uno script", 10 | "no": "Kjør et skript", 11 | "sv": "Kör ett skript", 12 | "pl": "Uruchom skrypt", 13 | "ru": "Запустить скрипт", 14 | "ko": "스크립트 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[script]]", 18 | "nl": "Voer [[script]] uit", 19 | "da": "Kør [[script]]", 20 | "de": "Führe [[script]] aus", 21 | "es": "Ejecutar [[script]]", 22 | "fr": "Exécuter [[script]]", 23 | "it": "Esegui [[script]]", 24 | "no": "Kjør [[script]]", 25 | "sv": "Kör [[script]]", 26 | "pl": "Uruchom [[script]]", 27 | "ru": "Запустить [[script]]", 28 | "ko": "[[script]] 실행" 29 | }, 30 | "args": [ 31 | { 32 | "name": "script", 33 | "type": "autocomplete", 34 | "title": { 35 | "en": "Script", 36 | "nl": "Script", 37 | "da": "Skript", 38 | "de": "Skript", 39 | "es": "Script", 40 | "fr": "Script", 41 | "it": "Script", 42 | "no": "Skript", 43 | "sv": "Skript", 44 | "pl": "Skrypt", 45 | "ru": "Скрипт", 46 | "ko": "스크립트" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /lib/flow/conditions/RunCodeWithArgCondition.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeWithArgCondition extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getConditionCard('runCodeWithArg') 15 | .registerRunListener(async ({ code, argument }, state) => { 16 | return Boolean( 17 | await this.homey.app.runScript({ 18 | id: '__temporary__', 19 | name: 'Test', 20 | code, 21 | args: [argument], 22 | realtime: state.realtime != null ? state.realtime : false, 23 | version: 1, 24 | }), 25 | ); 26 | }); 27 | 28 | this.homey.flow 29 | .getConditionCard('runCodeWithArg_v2') 30 | .registerRunListener(async ({ code, argument }, state) => { 31 | return Boolean( 32 | await this.homey.app.runScript({ 33 | id: '__temporary__', 34 | name: 'Test', 35 | code, 36 | args: [argument], 37 | realtime: state.realtime != null ? state.realtime : false, 38 | version: 2, 39 | }), 40 | ); 41 | }); 42 | } 43 | } 44 | 45 | module.exports = { RunCodeWithArgCondition }; 46 | -------------------------------------------------------------------------------- /.homeycompose/flow/conditions/runCode_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Запустить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]]", 18 | "nl": "Voer [[code]] uit", 19 | "da": "Kør [[code]]", 20 | "de": "Führen Sie [[code]] aus", 21 | "es": "Ejecutar [[code]]", 22 | "fr": "Exécuter [[code]]", 23 | "it": "Esegui [[code]]", 24 | "no": "Kjør [[code]]", 25 | "sv": "Kör [[code]]", 26 | "pl": "Uruchom [[code]]", 27 | "ru": "Запустить [[code]]", 28 | "ko": "[[code]] 실행" 29 | }, 30 | "advanced": true, 31 | "args": [ 32 | { 33 | "name": "code", 34 | "type": "code", 35 | "language": "homeyscript", 36 | "title": { 37 | "en": "Code", 38 | "nl": "Code", 39 | "da": "Kode", 40 | "de": "Code", 41 | "es": "Código", 42 | "fr": "Code", 43 | "it": "Codice", 44 | "no": "Kode", 45 | "sv": "Kod", 46 | "pl": "Kod", 47 | "ru": "Код", 48 | "ko": "코드" 49 | }, 50 | "value": "// My Code\n\nreturn true;" 51 | } 52 | ] 53 | } -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeReturnsNumberAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeReturnsNumberAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeReturnsNumber') 15 | .registerRunListener(async ({ code }, state) => { 16 | const result = await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | 25 | return { 26 | number: result, 27 | }; 28 | }); 29 | 30 | this.homey.flow 31 | .getActionCard('runCodeReturnsNumber_v2') 32 | .registerRunListener(async ({ code }, state) => { 33 | const result = await this.homey.app.runScript({ 34 | id: '__temporary__', 35 | name: 'Test', 36 | code, 37 | args: [], 38 | realtime: state.realtime != null ? state.realtime : false, 39 | version: 2, 40 | }); 41 | 42 | return { 43 | number: result, 44 | }; 45 | }); 46 | } 47 | } 48 | 49 | module.exports = { RunCodeReturnsNumberAction }; 50 | -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeReturnsStringAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeReturnsStringAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeReturnsString') 15 | .registerRunListener(async ({ code }, state) => { 16 | const result = await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | 25 | return { 26 | string: result, 27 | }; 28 | }); 29 | 30 | this.homey.flow 31 | .getActionCard('runCodeReturnsString_v2') 32 | .registerRunListener(async ({ code }, state) => { 33 | const result = await this.homey.app.runScript({ 34 | id: '__temporary__', 35 | name: 'Test', 36 | code, 37 | args: [], 38 | realtime: state.realtime != null ? state.realtime : false, 39 | version: 2, 40 | }); 41 | 42 | return { 43 | string: result, 44 | }; 45 | }); 46 | } 47 | } 48 | 49 | module.exports = { RunCodeReturnsStringAction }; 50 | -------------------------------------------------------------------------------- /.homeycompose/flow/conditions/runCode.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]]", 19 | "nl": "Voer [[code]] uit", 20 | "da": "Kør [[code]]", 21 | "de": "Führen Sie [[code]] aus", 22 | "es": "Ejecutar [[code]]", 23 | "fr": "Exécuter [[code]]", 24 | "it": "Esegui [[code]]", 25 | "no": "Kjør [[code]]", 26 | "sv": "Kör [[code]]", 27 | "pl": "Uruchom [[code]]", 28 | "ru": "Запустить [[code]]", 29 | "ko": "[[code]] 실행" 30 | }, 31 | "advanced": true, 32 | "args": [ 33 | { 34 | "name": "code", 35 | "type": "code", 36 | "language": "homeyscript", 37 | "title": { 38 | "en": "Code", 39 | "nl": "Code", 40 | "da": "Kode", 41 | "de": "Code", 42 | "es": "Código", 43 | "fr": "Code", 44 | "it": "Codice", 45 | "no": "Kode", 46 | "sv": "Kod", 47 | "pl": "Kod", 48 | "ru": "Код", 49 | "ko": "코드" 50 | }, 51 | "value": "// My Code\n\nreturn true;" 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeReturnsBooleanAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeReturnsBooleanAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeReturnsBoolean') 15 | .registerRunListener(async ({ code }, state) => { 16 | const result = await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | 25 | return { 26 | boolean: result, 27 | }; 28 | }); 29 | 30 | this.homey.flow 31 | .getActionCard('runCodeReturnsBoolean_v2') 32 | .registerRunListener(async ({ code }, state) => { 33 | const result = await this.homey.app.runScript({ 34 | id: '__temporary__', 35 | name: 'Test', 36 | code, 37 | args: [], 38 | realtime: state.realtime != null ? state.realtime : false, 39 | version: 2, 40 | }); 41 | 42 | return { 43 | boolean: result, 44 | }; 45 | }); 46 | } 47 | } 48 | 49 | module.exports = { RunCodeReturnsBooleanAction }; 50 | -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeWithArgReturnsNumberAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeWithArgReturnsNumberAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeWithArgReturnsNumber') 15 | .registerRunListener(async ({ code, argument }, state) => { 16 | const result = await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [argument], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | 25 | return { 26 | number: result, 27 | }; 28 | }); 29 | 30 | this.homey.flow 31 | .getActionCard('runCodeWithArgReturnsNumber_v2') 32 | .registerRunListener(async ({ code, argument }, state) => { 33 | const result = await this.homey.app.runScript({ 34 | id: '__temporary__', 35 | name: 'Test', 36 | code, 37 | args: [argument], 38 | realtime: state.realtime != null ? state.realtime : false, 39 | version: 2, 40 | }); 41 | 42 | return { 43 | number: result, 44 | }; 45 | }); 46 | } 47 | } 48 | 49 | module.exports = { RunCodeWithArgReturnsNumberAction }; 50 | -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeWithArgReturnsStringAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeWithArgReturnsStringAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeWithArgReturnsString') 15 | .registerRunListener(async ({ code, argument }, state) => { 16 | const result = await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [argument], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | 25 | return { 26 | string: result, 27 | }; 28 | }); 29 | 30 | this.homey.flow 31 | .getActionCard('runCodeWithArgReturnsString_v2') 32 | .registerRunListener(async ({ code, argument }, state) => { 33 | const result = await this.homey.app.runScript({ 34 | id: '__temporary__', 35 | name: 'Test', 36 | code, 37 | args: [argument], 38 | realtime: state.realtime != null ? state.realtime : false, 39 | version: 2, 40 | }); 41 | 42 | return { 43 | string: result, 44 | }; 45 | }); 46 | } 47 | } 48 | 49 | module.exports = { RunCodeWithArgReturnsStringAction }; 50 | -------------------------------------------------------------------------------- /lib/flow/actions/RunCodeWithArgReturnsBooleanAction.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { Base } = require('../../Base'); 4 | 5 | class RunCodeWithArgReturnsBooleanAction extends Base { 6 | /** 7 | * @param {Object} options 8 | * @param {import('@types/homey/lib/Homey')} options.homey 9 | */ 10 | constructor({ homey }) { 11 | super({ homey }); 12 | 13 | this.homey.flow 14 | .getActionCard('runCodeWithArgReturnsBoolean') 15 | .registerRunListener(async ({ code, argument }, state) => { 16 | const result = await this.homey.app.runScript({ 17 | id: '__temporary__', 18 | name: 'Test', 19 | code, 20 | args: [argument], 21 | realtime: state.realtime != null ? state.realtime : false, 22 | version: 1, 23 | }); 24 | 25 | return { 26 | boolean: result, 27 | }; 28 | }); 29 | 30 | this.homey.flow 31 | .getActionCard('runCodeWithArgReturnsBoolean_v2') 32 | .registerRunListener(async ({ code, argument }, state) => { 33 | const result = await this.homey.app.runScript({ 34 | id: '__temporary__', 35 | name: 'Test', 36 | code, 37 | args: [argument], 38 | realtime: state.realtime != null ? state.realtime : false, 39 | version: 2, 40 | }); 41 | 42 | return { 43 | boolean: result, 44 | }; 45 | }); 46 | } 47 | } 48 | 49 | module.exports = { RunCodeWithArgReturnsBooleanAction }; 50 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | # Version: 2.0.1 4 | # Modified: Yes 5 | # 6 | # Secrets: 7 | # - HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN 8 | # - SSH_KEY 9 | 10 | # GitHub repo configuration: 11 | # 1. If you have protected branches, go to Branches > edit protected branch > enable 'Require status checks to pass before 12 | # merging' and select the 'ESLint' status check. 13 | 14 | # Note: make sure to commit package-lock.json, this is needed for `npm ci`. 15 | 16 | # Defines the trigger for this action (e.g. [pull_request, push]) 17 | # For more information see: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#about-workflow-events) 18 | on: 19 | workflow_dispatch: 20 | pull_request: 21 | push: 22 | branches: 23 | - master 24 | - develop 25 | 26 | jobs: 27 | lint: 28 | name: Lint 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: actions/checkout@v4 32 | 33 | - uses: webfactory/ssh-agent@v0.9.0 34 | env: 35 | SSH_KEY: ${{ secrets.SSH_KEY }} 36 | if: env.SSH_KEY != null 37 | with: 38 | ssh-private-key: ${{ env.SSH_KEY }} 39 | 40 | # Setup 41 | - name: Setup Node.js 42 | uses: actions/setup-node@v4 43 | with: 44 | node-version-file: '.nvmrc' 45 | registry-url: 'https://npm.pkg.github.com' 46 | 47 | - name: Install modules 48 | run: npm clean-install --audit=false 49 | env: 50 | GITHUB_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }} 51 | 52 | - name: Lint 53 | run: npm run lint -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.athom.homeyscript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "lint": "eslint .", 8 | "start": "nodemon --watch . --exec \"homey app run\"", 9 | "serve": "concurrently \"serve -l 5000 build/\" \"npm run jsdoc:watch\"", 10 | "build": "npm run jsdoc:clean; npm run jsdoc;", 11 | "jsdoc": "jsdoc --configure ./docs/jsdoc.json;", 12 | "jsdoc:clean": "rm -rf ./build", 13 | "jsdoc:watch": "watch \"npm run jsdoc:clean && npm run jsdoc\" ./docs docs" 14 | }, 15 | "nodemonConfig": { 16 | "ignore": [ 17 | "app.json", 18 | "build" 19 | ] 20 | }, 21 | "engines": { 22 | "node": ">=18" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "git+https://github.com/athombv/com.athom.homeyscript.git" 27 | }, 28 | "author": "", 29 | "license": "ISC", 30 | "bugs": { 31 | "url": "https://github.com/athombv/com.athom.homeyscript/issues" 32 | }, 33 | "homepage": "https://github.com/athombv/com.athom.homeyscript#readme", 34 | "dependencies": { 35 | "athom-api": "^3.9.2", 36 | "homey-api": "^3.4.33", 37 | "lodash": "^4.17.21", 38 | "node-fetch": "^2.7.0", 39 | "uuid": "^8.3.2" 40 | }, 41 | "devDependencies": { 42 | "@types/homey": "npm:homey-apps-sdk-v3-types@^0.3.5", 43 | "concurrently": "^8.2.2", 44 | "eslint": "^8.57.0", 45 | "eslint-config-prettier": "^9.1.0", 46 | "homey-jsdoc-template": "github:athombv/homey-jsdoc-template#1.5.2", 47 | "jsdoc": "^3.6.11", 48 | "jsdoc-ts-utils": "^5.0.0", 49 | "prettier": "^3.2.5", 50 | "serve": "^14.2.3", 51 | "watch": "^1.0.2" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /api.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | async getScripts({ homey, query }) { 5 | const scripts = await homey.app.getScripts(); 6 | const response = {}; 7 | 8 | for (const script of Object.values(scripts)) { 9 | response[script.id] = { 10 | ...script, 11 | code: undefined, 12 | }; 13 | } 14 | 15 | return response; 16 | }, 17 | 18 | async getScript({ homey, params }) { 19 | const { id } = params; 20 | return homey.app.getScript({ id }); 21 | }, 22 | 23 | async runScript({ homey, params, body = {} }) { 24 | const { id } = params; 25 | const { code, args } = body; 26 | 27 | try { 28 | const script = await homey.app.getScript({ id }); 29 | 30 | const result = await homey.app.runScript({ 31 | id: script.id, 32 | name: script.name, 33 | code: code ?? script.code, 34 | lastExecuted: script.lastExecuted, 35 | version: script.version, 36 | args, 37 | }).finally(() => { 38 | homey.app.updateScript({ id: script.id, lastExecuted: new Date() }).catch(() => {}); 39 | }); 40 | 41 | return { 42 | success: true, 43 | returns: result, 44 | }; 45 | } catch (err) { 46 | return { 47 | success: false, 48 | returns: { 49 | message: err.message, 50 | stack: err.stack, 51 | }, 52 | }; 53 | } 54 | }, 55 | 56 | async createScript({ homey, params, body = {} }) { 57 | const { name, code } = body; 58 | 59 | return homey.app.createScript({ name, code }); 60 | }, 61 | 62 | async updateScript({ 63 | homey, params, query, body = {}, 64 | }) { 65 | const { id } = params; 66 | const { name, code, version } = body; 67 | 68 | return homey.app.updateScript({ id, name, code, version }); 69 | }, 70 | 71 | async deleteScript({ homey, params }) { 72 | const { id } = params; 73 | return homey.app.deleteScript({ id }); 74 | }, 75 | 76 | }; 77 | -------------------------------------------------------------------------------- /.homeycompose/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "com.athom.homeyscript", 3 | "sdk": 3, 4 | "version": "3.6.0", 5 | "compatibility": ">=5.0.0", 6 | "name": { 7 | "en": "HomeyScript", 8 | "nl": "HomeyScript", 9 | "da": "HomeyScript", 10 | "de": "HomeyScript", 11 | "es": "HomeyScript", 12 | "fr": "HomeyScript", 13 | "it": "HomeyScript", 14 | "no": "HomeyScript", 15 | "sv": "HomeyScript", 16 | "pl": "HomeyScript", 17 | "ru": "HomeyScript", 18 | "ko": "HomeyScript" 19 | }, 20 | "brandColor": "#2B1F32", 21 | "description": { 22 | "en": "Script your Home", 23 | "nl": "Script je Huis", 24 | "da": "Skript dit Hjem", 25 | "de": "Skripte dein Zuhause", 26 | "es": "Escribe un guión para tu hogar", 27 | "fr": "Script ton Domicile", 28 | "it": "Scriptare la tua Casa", 29 | "no": "Skript ditt Hjem", 30 | "sv": "Script ditt Hem", 31 | "pl": "Skryptuj Swój Dom", 32 | "ru": "Скрипт твоего Дома", 33 | "ko": "당신의 집을 스크립트로 작성하세요" 34 | }, 35 | "permissions": [ 36 | "homey:manager:api" 37 | ], 38 | "category": "tools", 39 | "author": { 40 | "name": "Athom B.V." 41 | }, 42 | "images": { 43 | "xlarge": "/assets/images/xlarge.png", 44 | "large": "/assets/images/large.png", 45 | "small": "/assets/images/small.png" 46 | }, 47 | "homepage": "https://my.homey.app/scripts", 48 | "support": "https://github.com/athombv/com.athom.homeyscript#disclaimer", 49 | "source": "https://github.com/athombv/com.athom.homeyscript", 50 | "platforms": [ 51 | "local" 52 | ], 53 | "api": { 54 | "getScripts": { 55 | "method": "get", 56 | "path": "/script" 57 | }, 58 | "getScript": { 59 | "method": "get", 60 | "path": "/script/:id" 61 | }, 62 | "runScript": { 63 | "method": "post", 64 | "path": "/script/:id/run" 65 | }, 66 | "createScript": { 67 | "method": "post", 68 | "path": "/script" 69 | }, 70 | "updateScript": { 71 | "method": "put", 72 | "path": "/script/:id" 73 | }, 74 | "deleteScript": { 75 | "method": "delete", 76 | "path": "/script/:id" 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeReturnsNumber_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Выполнить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] and return Number-tag", 18 | "nl": "Voer [[code]] uit en return Nummer-tag", 19 | "da": "Kør [[code]] og returner nummer-tag", 20 | "de": "Führe [[code]] aus und gib Nummer-Tag zurück", 21 | "es": "Ejecuta [[code]] y devuelve la etiqueta de número", 22 | "fr": "Exécuter [[code]] et retourner l'étiquette de numéro", 23 | "it": "Esegui [[code]] e restituisci il tag numero", 24 | "no": "Kjør [[code]] og returner tallkode", 25 | "sv": "Kör [[code]] och returnera siffertagg", 26 | "pl": "Uruchom [[code]] i zwróć tag liczbowy", 27 | "ru": "Выполнить [[code]] и вернуть тег номера", 28 | "ko": "[[code]] 실행 후 숫자 태그 반환" 29 | }, 30 | "tokens": [ 31 | { 32 | "name": "number", 33 | "type": "number", 34 | "title": { 35 | "en": "Result", 36 | "nl": "Resultaat", 37 | "da": "Resultat", 38 | "de": "Ergebnis", 39 | "es": "Resultado", 40 | "fr": "Résultat", 41 | "it": "Risultato", 42 | "no": "Resultat", 43 | "sv": "Resultat", 44 | "pl": "Wynik", 45 | "ru": "Результат", 46 | "ko": "결과" 47 | } 48 | } 49 | ], 50 | "args": [ 51 | { 52 | "name": "code", 53 | "type": "code", 54 | "language": "homeyscript", 55 | "title": { 56 | "en": "Code", 57 | "nl": "Code", 58 | "da": "Kode", 59 | "de": "Code", 60 | "es": "Código", 61 | "fr": "Code", 62 | "it": "Codice", 63 | "no": "Kode", 64 | "sv": "Kod", 65 | "pl": "Kod", 66 | "ru": "Код", 67 | "ko": "코드" 68 | }, 69 | "value": "// My Code\n\nreturn 1;" 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeReturnsBoolean_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui il codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Запустить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] and return Yes/No-tag", 18 | "nl": "Voer [[code]] uit en return Ja/Nee-tag", 19 | "da": "Kør [[code]] og returner Ja/Nej-tag", 20 | "de": "Führe [[code]] aus und gib Ja/Nein-Tag zurück", 21 | "es": "Ejecutar [[code]] y devolver etiqueta Sí/No", 22 | "fr": "Exécuter [[code]] et renvoyer l'étiquette Oui/Non", 23 | "it": "Esegui [[code]] e restituisci tag Sì/No", 24 | "no": "Kjør [[code]] og returner Ja/Nei-merke", 25 | "sv": "Kör [[code]] och returnera Ja/Nej-tag", 26 | "pl": "Uruchom [[code]] i zwróć tag Tak/Nie", 27 | "ru": "Запустить [[code]] и вернуть метку Да/Нет", 28 | "ko": "[[code]]를 실행하고 예/아니오 태그 반환" 29 | }, 30 | "tokens": [ 31 | { 32 | "name": "boolean", 33 | "type": "boolean", 34 | "title": { 35 | "en": "Result", 36 | "nl": "Resultaat", 37 | "da": "Resultat", 38 | "de": "Ergebnis", 39 | "es": "Resultado", 40 | "fr": "Résultat", 41 | "it": "Risultato", 42 | "no": "Resultat", 43 | "sv": "Resultat", 44 | "pl": "Wynik", 45 | "ru": "Результат", 46 | "ko": "결과" 47 | } 48 | } 49 | ], 50 | "args": [ 51 | { 52 | "name": "code", 53 | "type": "code", 54 | "language": "homeyscript", 55 | "title": { 56 | "en": "Code", 57 | "nl": "Code", 58 | "da": "Kode", 59 | "de": "Code", 60 | "es": "Código", 61 | "fr": "Code", 62 | "it": "Codice", 63 | "no": "Kode", 64 | "sv": "Kod", 65 | "pl": "Kod", 66 | "ru": "Код", 67 | "ko": "코드" 68 | }, 69 | "value": "// My Code\n\nreturn true;" 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeReturnsString_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Запустить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] and return Text-tag", 18 | "nl": "Voer [[code]] uit en return Tekst-tag", 19 | "da": "Kør [[code]] og returner tekst-tag", 20 | "de": "Führe [[code]] aus und gib Text-Tag zurück", 21 | "es": "Ejecuta [[code]] y devuelve etiqueta de texto", 22 | "fr": "Exécutez [[code]] et retournez une balise de texte", 23 | "it": "Esegui [[code]] e restituisci un tag di testo", 24 | "no": "Kjør [[code]] og returner tekst-tagg", 25 | "sv": "Kör [[code]] och returnera text-tagg", 26 | "pl": "Uruchom [[code]] i zwróć znacznik tekstu", 27 | "ru": "Запустите [[code]] и верните текстовый тег", 28 | "ko": "[[code]]를 실행하고 텍스트 태그 반환" 29 | }, 30 | "tokens": [ 31 | { 32 | "name": "string", 33 | "type": "string", 34 | "title": { 35 | "en": "Result", 36 | "nl": "Resultaat", 37 | "da": "Resultat", 38 | "de": "Ergebnis", 39 | "es": "Resultado", 40 | "fr": "Résultat", 41 | "it": "Risultato", 42 | "no": "Resultat", 43 | "sv": "Resultat", 44 | "pl": "Wynik", 45 | "ru": "Результат", 46 | "ko": "결과" 47 | } 48 | } 49 | ], 50 | "args": [ 51 | { 52 | "name": "code", 53 | "type": "code", 54 | "language": "homeyscript", 55 | "title": { 56 | "en": "Code", 57 | "nl": "Code", 58 | "da": "Kode", 59 | "de": "Code", 60 | "es": "Código", 61 | "fr": "Code", 62 | "it": "Codice", 63 | "no": "Kode", 64 | "sv": "Kod", 65 | "pl": "Kod", 66 | "ru": "Код", 67 | "ko": "코드" 68 | }, 69 | "value": "// My Code\n\nreturn 'Hello World!';" 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeReturnsBoolean.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui il codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] and return Yes/No-tag", 19 | "nl": "Voer [[code]] uit en return Ja/Nee-tag", 20 | "da": "Kør [[code]] og returner Ja/Nej-tag", 21 | "de": "Führen Sie [[code]] aus und geben Sie Ja/Nein-Tag zurück", 22 | "es": "Ejecutar [[code]] y devolver etiqueta Sí/No", 23 | "fr": "Exécuter [[code]] et retourner le tag Oui/Non", 24 | "it": "Esegui [[code]] e restituisci il tag Sì/No", 25 | "no": "Kjør [[code]] og returner Ja/Nei-tag", 26 | "sv": "Kör [[code]] och returnera Ja/Nej-tag", 27 | "pl": "Uruchom [[code]] i zwróć tag Tak/Nie", 28 | "ru": "Выполните [[code]] и верните тег Да/Нет", 29 | "ko": "[[code]] 실행하고 예/아니오 태그 반환" 30 | }, 31 | "tokens": [ 32 | { 33 | "name": "boolean", 34 | "type": "boolean", 35 | "title": { 36 | "en": "Result", 37 | "nl": "Resultaat", 38 | "da": "Resultat", 39 | "de": "Ergebnis", 40 | "es": "Resultado", 41 | "fr": "Résultat", 42 | "it": "Risultato", 43 | "no": "Resultat", 44 | "sv": "Resultat", 45 | "pl": "Wynik", 46 | "ru": "Результат", 47 | "ko": "결과" 48 | } 49 | } 50 | ], 51 | "args": [ 52 | { 53 | "name": "code", 54 | "type": "code", 55 | "language": "homeyscript", 56 | "title": { 57 | "en": "Code", 58 | "nl": "Code", 59 | "da": "Kode", 60 | "de": "Code", 61 | "es": "Código", 62 | "fr": "Code", 63 | "it": "Codice", 64 | "no": "Kode", 65 | "sv": "Kod", 66 | "pl": "Kod", 67 | "ru": "Код", 68 | "ko": "코드" 69 | }, 70 | "value": "// My Code\n\nreturn true;" 71 | } 72 | ] 73 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeReturnsNumber.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter du code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] and return Number-tag", 19 | "nl": "Voer [[code]] uit en return Nummer-tag", 20 | "da": "Kør [[code]] og returner nummer-tag", 21 | "de": "Führen Sie [[code]] aus und geben Sie Nummer-Tag zurück", 22 | "es": "Ejecuta [[code]] y devuelve la etiqueta de número", 23 | "fr": "Exécutez [[code]] et retournez l'étiquette de nombre", 24 | "it": "Esegui [[code]] e restituisci il tag numero", 25 | "no": "Kjør [[code]] og returner nummer-merke", 26 | "sv": "Kör [[code]] och returnera nummer-taggen", 27 | "pl": "Uruchom [[code]] i zwróć tag liczbowy", 28 | "ru": "Запустить [[code]] и вернуть тег числа", 29 | "ko": "[[code]] 실행하고 숫자 태그 반환" 30 | }, 31 | "tokens": [ 32 | { 33 | "name": "number", 34 | "type": "number", 35 | "title": { 36 | "en": "Result", 37 | "nl": "Resultaat", 38 | "da": "Resultat", 39 | "de": "Ergebnis", 40 | "es": "Resultado", 41 | "fr": "Résultat", 42 | "it": "Risultato", 43 | "no": "Resultat", 44 | "sv": "Resultat", 45 | "pl": "Wynik", 46 | "ru": "Результат", 47 | "ko": "결과" 48 | } 49 | } 50 | ], 51 | "args": [ 52 | { 53 | "name": "code", 54 | "type": "code", 55 | "language": "homeyscript", 56 | "title": { 57 | "en": "Code", 58 | "nl": "Code", 59 | "da": "Kode", 60 | "de": "Code", 61 | "es": "Código", 62 | "fr": "Code", 63 | "it": "Codice", 64 | "no": "Kode", 65 | "sv": "Kod", 66 | "pl": "Kod", 67 | "ru": "Код", 68 | "ko": "코드" 69 | }, 70 | "value": "// My Code\n\nreturn 1;" 71 | } 72 | ] 73 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeReturnsString.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui il codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] and return Text-tag", 19 | "nl": "Voer [[code]] uit en return Tekst-tag", 20 | "da": "Kør [[code]] og returner tekst-tag", 21 | "de": "Führe [[code]] aus und gib Text-Tag zurück", 22 | "es": "Ejecuta [[code]] y devuelve etiqueta de texto", 23 | "fr": "Exécutez [[code]] et renvoyez l'étiquette de texte", 24 | "it": "Esegui [[code]] e restituisci l'etichetta di testo", 25 | "no": "Kjør [[code]] og returner tekst-etikett", 26 | "sv": "Kör [[code]] och returnera text-tagg", 27 | "pl": "Uruchom [[code]] i zwróć tag tekstowy", 28 | "ru": "Запустите [[code]] и верните текстовый тег", 29 | "ko": "[[code]]을 실행하고 텍스트 태그 반환" 30 | }, 31 | "tokens": [ 32 | { 33 | "name": "string", 34 | "type": "string", 35 | "title": { 36 | "en": "Result", 37 | "nl": "Resultaat", 38 | "da": "Resultat", 39 | "de": "Ergebnis", 40 | "es": "Resultado", 41 | "fr": "Résultat", 42 | "it": "Risultato", 43 | "no": "Resultat", 44 | "sv": "Resultat", 45 | "pl": "Wynik", 46 | "ru": "Результат", 47 | "ko": "결과" 48 | } 49 | } 50 | ], 51 | "args": [ 52 | { 53 | "name": "code", 54 | "type": "code", 55 | "language": "homeyscript", 56 | "title": { 57 | "en": "Code", 58 | "nl": "Code", 59 | "da": "Kode", 60 | "de": "Code", 61 | "es": "Código", 62 | "fr": "Code", 63 | "it": "Codice", 64 | "no": "Kode", 65 | "sv": "Kod", 66 | "pl": "Kod", 67 | "ru": "Код", 68 | "ko": "코드" 69 | }, 70 | "value": "// My Code\n\nreturn 'Hello World!';" 71 | } 72 | ] 73 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArg_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Запуск кода", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] with [[argument]]", 18 | "nl": "Voer [[code]] uit met [[argument]]", 19 | "da": "Kør [[code]] med [[argument]]", 20 | "de": "Führe [[code]] mit [[argument]] aus", 21 | "es": "Ejecutar [[code]] con [[argument]]", 22 | "fr": "Exécuter [[code]] avec [[argument]]", 23 | "it": "Esegui [[code]] con [[argument]]", 24 | "no": "Kjør [[code]] med [[argument]]", 25 | "sv": "Kör [[code]] med [[argument]]", 26 | "pl": "Uruchom [[code]] z [[argument]]", 27 | "ru": "Запустить [[code]] с [[argument]]", 28 | "ko": "[[code]] 실행[[argument]]" 29 | }, 30 | "advanced": true, 31 | "args": [ 32 | { 33 | "name": "code", 34 | "type": "code", 35 | "language": "homeyscript", 36 | "title": { 37 | "en": "Code", 38 | "nl": "Code", 39 | "da": "Kode", 40 | "de": "Code", 41 | "es": "Código", 42 | "fr": "Code", 43 | "it": "Codice", 44 | "no": "Kode", 45 | "sv": "Kod", 46 | "pl": "Kod", 47 | "ru": "Код", 48 | "ko": "코드" 49 | }, 50 | "value": "// My Code\n\nconsole.log(args[0]);" 51 | }, 52 | { 53 | "name": "argument", 54 | "type": "text", 55 | "required": false, 56 | "title": { 57 | "en": "Argument", 58 | "nl": "Argument", 59 | "da": "Argument", 60 | "de": "Argument", 61 | "es": "Argumento", 62 | "fr": "Argument", 63 | "it": "Argomento", 64 | "no": "Argument", 65 | "sv": "Argument", 66 | "pl": "Argument", 67 | "ru": "Аргумент", 68 | "ko": "인수" 69 | }, 70 | "placeholder": { 71 | "en": "Argument", 72 | "nl": "Argument", 73 | "da": "Argument", 74 | "de": "Argument", 75 | "es": "Argumento", 76 | "fr": "Argument", 77 | "it": "Argomento", 78 | "no": "Argument", 79 | "sv": "Argument", 80 | "pl": "Argument", 81 | "ru": "Аргумент", 82 | "ko": "인수" 83 | }, 84 | "value": "MyArg" 85 | } 86 | ] 87 | } -------------------------------------------------------------------------------- /.homeycompose/flow/conditions/runCodeWithArg_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Запустить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] with [[argument]]", 18 | "nl": "Voer [[code]] uit met [[argument]]", 19 | "da": "Kør [[code]] med [[argument]]", 20 | "de": "Führe [[code]] mit [[argument]] aus", 21 | "es": "Ejecutar [[code]] con [[argument]]", 22 | "fr": "Exécuter [[code]] avec [[argument]]", 23 | "it": "Esegui [[code]] con [[argument]]", 24 | "no": "Kjør [[code]] med [[argument]]", 25 | "sv": "Kör [[code]] med [[argument]]", 26 | "pl": "Uruchom [[code]] z [[argument]]", 27 | "ru": "Запустить [[code]] с [[argument]]", 28 | "ko": "[[code]] 실행 [[argument]]" 29 | }, 30 | "advanced": true, 31 | "args": [ 32 | { 33 | "name": "code", 34 | "type": "code", 35 | "language": "homeyscript", 36 | "title": { 37 | "en": "Code", 38 | "nl": "Code", 39 | "da": "Kode", 40 | "de": "Code", 41 | "es": "Código", 42 | "fr": "Code", 43 | "it": "Codice", 44 | "no": "Kode", 45 | "sv": "Kod", 46 | "pl": "Kod", 47 | "ru": "Код", 48 | "ko": "코드" 49 | }, 50 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 51 | }, 52 | { 53 | "name": "argument", 54 | "type": "text", 55 | "required": false, 56 | "title": { 57 | "en": "Argument", 58 | "nl": "Argument", 59 | "da": "Argument", 60 | "de": "Argument", 61 | "es": "Argumento", 62 | "fr": "Argument", 63 | "it": "Argomento", 64 | "no": "Argument", 65 | "sv": "Argument", 66 | "pl": "Argument", 67 | "ru": "Аргумент", 68 | "ko": "인수" 69 | }, 70 | "placeholder": { 71 | "en": "Argument", 72 | "nl": "Argument", 73 | "da": "Argument", 74 | "de": "Argument", 75 | "es": "Argumento", 76 | "fr": "Argument", 77 | "it": "Argomento", 78 | "no": "Argument", 79 | "sv": "Argument", 80 | "pl": "Argument", 81 | "ru": "Аргумент", 82 | "ko": "인수" 83 | }, 84 | "value": "MyArg" 85 | } 86 | ] 87 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArg.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] with [[argument]]", 19 | "nl": "Voer [[code]] uit met [[argument]]", 20 | "da": "Kør [[code]] med [[argument]]", 21 | "de": "Führen Sie [[code]] mit [[argument]] aus", 22 | "es": "Ejecutar [[code]] con [[argument]]", 23 | "fr": "Exécuter [[code]] avec [[argument]]", 24 | "it": "Esegui [[code]] con [[argument]]", 25 | "no": "Kjør [[code]] med [[argument]]", 26 | "sv": "Kör [[code]] med [[argument]]", 27 | "pl": "Uruchom [[code]] z [[argument]]", 28 | "ru": "Запустить [[code]] с [[argument]]", 29 | "ko": "[[argument]]으로 [[code]] 실행" 30 | }, 31 | "advanced": true, 32 | "args": [ 33 | { 34 | "name": "code", 35 | "type": "code", 36 | "language": "homeyscript", 37 | "title": { 38 | "en": "Code", 39 | "nl": "Code", 40 | "da": "Kode", 41 | "de": "Code", 42 | "es": "Código", 43 | "fr": "Code", 44 | "it": "Codice", 45 | "no": "Kode", 46 | "sv": "Kod", 47 | "pl": "Kod", 48 | "ru": "Код", 49 | "ko": "코드" 50 | }, 51 | "value": "// My Code\n\nconsole.log(args[0]);" 52 | }, 53 | { 54 | "name": "argument", 55 | "type": "text", 56 | "required": false, 57 | "title": { 58 | "en": "Argument", 59 | "nl": "Argument", 60 | "da": "Argument", 61 | "de": "Argument", 62 | "es": "Argumento", 63 | "fr": "Argument", 64 | "it": "Argomento", 65 | "no": "Argument", 66 | "sv": "Argument", 67 | "pl": "Argument", 68 | "ru": "Аргумент", 69 | "ko": "인수" 70 | }, 71 | "placeholder": { 72 | "en": "Argument", 73 | "nl": "Argument", 74 | "da": "Argument", 75 | "de": "Argument", 76 | "es": "Argumento", 77 | "fr": "Argument", 78 | "it": "Argomento", 79 | "no": "Argument", 80 | "sv": "Argument", 81 | "pl": "Argument", 82 | "ru": "Аргумент", 83 | "ko": "인수" 84 | }, 85 | "value": "MyArg" 86 | } 87 | ] 88 | } -------------------------------------------------------------------------------- /.homeycompose/flow/conditions/runCodeWithArg.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] with [[argument]]", 19 | "nl": "Voer [[code]] uit met [[argument]]", 20 | "da": "Kør [[code]] med [[argument]]", 21 | "de": "Führe [[code]] mit [[argument]] aus", 22 | "es": "Ejecuta [[code]] con [[argument]]", 23 | "fr": "Exécutez [[code]] avec [[argument]]", 24 | "it": "Esegui [[code]] con [[argument]]", 25 | "no": "Kjør [[code]] med [[argument]]", 26 | "sv": "Kör [[code]] med [[argument]]", 27 | "pl": "Uruchom [[code]] z [[argument]]", 28 | "ru": "Запустить [[code]] с [[argument]]", 29 | "ko": "[[argument]]과 함께 [[code]] 실행" 30 | }, 31 | "advanced": true, 32 | "args": [ 33 | { 34 | "name": "code", 35 | "type": "code", 36 | "language": "homeyscript", 37 | "title": { 38 | "en": "Code", 39 | "nl": "Code", 40 | "da": "Kode", 41 | "de": "Code", 42 | "es": "Código", 43 | "fr": "Code", 44 | "it": "Codice", 45 | "no": "Kode", 46 | "sv": "Kod", 47 | "pl": "Kod", 48 | "ru": "Код", 49 | "ko": "코드" 50 | }, 51 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 52 | }, 53 | { 54 | "name": "argument", 55 | "type": "text", 56 | "required": false, 57 | "title": { 58 | "en": "Argument", 59 | "nl": "Argument", 60 | "da": "Argument", 61 | "de": "Argument", 62 | "es": "Argumento", 63 | "fr": "Argument", 64 | "it": "Argomento", 65 | "no": "Argument", 66 | "sv": "Argument", 67 | "pl": "Argument", 68 | "ru": "Аргумент", 69 | "ko": "인수" 70 | }, 71 | "placeholder": { 72 | "en": "Argument", 73 | "nl": "Argument", 74 | "da": "Argument", 75 | "de": "Argument", 76 | "es": "Argumento", 77 | "fr": "Argument", 78 | "it": "Argomento", 79 | "no": "Argument", 80 | "sv": "Argument", 81 | "pl": "Argument", 82 | "ru": "Аргумент", 83 | "ko": "인수" 84 | }, 85 | "value": "MyArg" 86 | } 87 | ] 88 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runWithArg.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run a script with an argument", 4 | "nl": "Voer een script uit met een argument", 5 | "da": "Kør et script med et argument", 6 | "de": "Führe ein Script mit einem Argument aus", 7 | "es": "Ejecutar un script con un argumento", 8 | "fr": "Exécuter un script avec un argument", 9 | "it": "Eseguire uno script con un argomento", 10 | "no": "Kjør et skript med et argument", 11 | "sv": "Kör ett skript med ett argument", 12 | "pl": "Uruchom skrypt z argumentem", 13 | "ru": "Запустить скрипт с аргументом", 14 | "ko": "인수를 사용하여 스크립트 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[script]] with argument [[argument]]", 18 | "nl": "Voer [[script]] uit met argument [[argument]]", 19 | "da": "Kør [[script]] med argument [[argument]]", 20 | "de": "Führe [[script]] mit dem Argument [[argument]] aus", 21 | "es": "Ejecutar [[script]] con argumento [[argument]]", 22 | "fr": "Exécuter [[script]] avec l'argument [[argument]]", 23 | "it": "Esegui [[script]] con l'argomento [[argument]]", 24 | "no": "Kjør [[script]] med argumentet [[argument]]", 25 | "sv": "Kör [[script]] med argumentet [[argument]]", 26 | "pl": "Uruchom [[script]] z argumentem [[argument]]", 27 | "ru": "Запуск [[script]] с аргументом [[argument]]", 28 | "ko": "[[script]]를 [[argument]] 인수로 실행" 29 | }, 30 | "args": [ 31 | { 32 | "name": "script", 33 | "type": "autocomplete", 34 | "title": { 35 | "en": "Script", 36 | "nl": "Script", 37 | "da": "Script", 38 | "de": "Script", 39 | "es": "Script", 40 | "fr": "Script", 41 | "it": "Script", 42 | "no": "Skript", 43 | "sv": "Skript", 44 | "pl": "Skrypt", 45 | "ru": "Скрипт", 46 | "ko": "스크립트" 47 | } 48 | }, 49 | { 50 | "name": "argument", 51 | "type": "text", 52 | "title": { 53 | "en": "Argument", 54 | "nl": "Argument", 55 | "da": "Argument", 56 | "de": "Argument", 57 | "es": "Argumento", 58 | "fr": "Argument", 59 | "it": "Argomento", 60 | "no": "Argument", 61 | "sv": "Argument", 62 | "pl": "Argument", 63 | "ru": "Аргумент", 64 | "ko": "인수" 65 | }, 66 | "placeholder": { 67 | "en": "Argument", 68 | "nl": "Argument", 69 | "da": "Argument", 70 | "de": "Argument", 71 | "es": "Argumento", 72 | "fr": "Argument", 73 | "it": "Argomento", 74 | "no": "Argument", 75 | "sv": "Argument", 76 | "pl": "Argument", 77 | "ru": "Аргумент", 78 | "ko": "인수" 79 | } 80 | } 81 | ] 82 | } -------------------------------------------------------------------------------- /.homeycompose/flow/conditions/runWithArg.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run a script with an argument", 4 | "nl": "Voer een script uit met een argument", 5 | "da": "Kør et script med et argument", 6 | "de": "Führen Sie ein Skript mit einem Argument aus", 7 | "es": "Ejecutar un script con un argumento", 8 | "fr": "Exécuter un script avec un argument", 9 | "it": "Esegui uno script con un argomento", 10 | "no": "Kjør et skript med et argument", 11 | "sv": "Kör ett skript med ett argument", 12 | "pl": "Uruchom skrypt z argumentem", 13 | "ru": "Запустите сценарий с аргументом", 14 | "ko": "인수를 사용하여 스크립트를 실행합니다" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[script]] with argument [[argument]]", 18 | "nl": "Voer [[script]] uit met argument [[argument]]", 19 | "da": "Kør [[script]] med argumentet [[argument]]", 20 | "de": "Führen Sie [[script]] mit Argument [[argument]] aus", 21 | "es": "Ejecutar [[script]] con el argumento [[argument]]", 22 | "fr": "Exécuter [[script]] avec l'argument [[argument]]", 23 | "it": "Esegui [[script]] con l'argomento [[argument]]", 24 | "no": "Kjør [[script]] med argumentet [[argument]]", 25 | "sv": "Kör [[script]] med argumentet [[argument]]", 26 | "pl": "Uruchom [[script]] z argumentem [[argument]]", 27 | "ru": "Запустите [[script]] с аргументом [[argument]]", 28 | "ko": "[[script]] 스크립트를 인수 [[argument]]와 함께 실행합니다" 29 | }, 30 | "args": [ 31 | { 32 | "name": "script", 33 | "type": "autocomplete", 34 | "title": { 35 | "en": "Script", 36 | "nl": "Script", 37 | "da": "Script", 38 | "de": "Script", 39 | "es": "Script", 40 | "fr": "Script", 41 | "it": "Script", 42 | "no": "Script", 43 | "sv": "Script", 44 | "pl": "Script", 45 | "ru": "Script", 46 | "ko": "Script" 47 | } 48 | }, 49 | { 50 | "name": "argument", 51 | "type": "text", 52 | "title": { 53 | "en": "Argument", 54 | "nl": "Argument", 55 | "da": "Argument", 56 | "de": "Argument", 57 | "es": "Argumento", 58 | "fr": "Argument", 59 | "it": "Argomento", 60 | "no": "Argument", 61 | "sv": "Argument", 62 | "pl": "Argument", 63 | "ru": "Аргумент", 64 | "ko": "인수" 65 | }, 66 | "placeholder": { 67 | "en": "Argument", 68 | "nl": "Argument", 69 | "da": "Argument", 70 | "de": "Argument", 71 | "es": "Argumento", 72 | "fr": "Argument", 73 | "it": "Argomento", 74 | "no": "Argument", 75 | "sv": "Argument", 76 | "pl": "Argument", 77 | "ru": "Аргумент", 78 | "ko": "인수" 79 | } 80 | } 81 | ] 82 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArgReturnsBoolean_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Выполнить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] with [[argument]] and return Yes/No-tag", 18 | "nl": "Voer [[code]] uit met [[argument]] en return Ja/Nee-tag", 19 | "da": "Kør [[code]] med [[argument]] og returner Ja/Nej-tag", 20 | "de": "Führe [[code]] mit [[argument]] aus und gib ein Ja/Nein-Tag zurück", 21 | "es": "Ejecuta [[code]] con [[argument]] y devuelve una etiqueta Sí/No", 22 | "fr": "Exécute [[code]] avec [[argument]] et retourne une étiquette Oui/Non", 23 | "it": "Esegui [[code]] con [[argument]] e restituisci una tag Sì/No", 24 | "no": "Kjør [[code]] med [[argument]] og returner Ja/Nei-merke", 25 | "sv": "Kör [[code]] med [[argument]] och returnera ett Ja/Nej-tag", 26 | "pl": "Uruchom [[code]] z [[argument]] i zwróć tag Tak/Nie", 27 | "ru": "Выполните [[code]] с [[argument]] и верните тег Да/Нет", 28 | "ko": "[[code]]를 [[argument]]으로 실행하고 예/아니오 태그 반환" 29 | }, 30 | "tokens": [ 31 | { 32 | "name": "boolean", 33 | "type": "boolean", 34 | "title": { 35 | "en": "Result", 36 | "nl": "Resultaat", 37 | "da": "Resultat", 38 | "de": "Ergebnis", 39 | "es": "Resultado", 40 | "fr": "Résultat", 41 | "it": "Risultato", 42 | "no": "Resultat", 43 | "sv": "Resultat", 44 | "pl": "Wynik", 45 | "ru": "Результат", 46 | "ko": "결과" 47 | } 48 | } 49 | ], 50 | "args": [ 51 | { 52 | "name": "code", 53 | "type": "code", 54 | "language": "homeyscript", 55 | "title": { 56 | "en": "Code", 57 | "nl": "Code", 58 | "da": "Kode", 59 | "de": "Code", 60 | "es": "Código", 61 | "fr": "Code", 62 | "it": "Codice", 63 | "no": "Kode", 64 | "sv": "Kod", 65 | "pl": "Kod", 66 | "ru": "Код", 67 | "ko": "코드" 68 | }, 69 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 70 | }, 71 | { 72 | "name": "argument", 73 | "type": "text", 74 | "required": false, 75 | "title": { 76 | "en": "Argument", 77 | "nl": "Argument", 78 | "da": "Argument", 79 | "de": "Argument", 80 | "es": "Argumento", 81 | "fr": "Argument", 82 | "it": "Argomento", 83 | "no": "Argument", 84 | "sv": "Argument", 85 | "pl": "Argument", 86 | "ru": "Аргумент", 87 | "ko": "인수" 88 | }, 89 | "placeholder": { 90 | "en": "Argument", 91 | "nl": "Argument", 92 | "da": "Argument", 93 | "de": "Argument", 94 | "es": "Argumento", 95 | "fr": "Argument", 96 | "it": "Argomento", 97 | "no": "Argument", 98 | "sv": "Argument", 99 | "pl": "Argument", 100 | "ru": "Аргумент", 101 | "ko": "인수" 102 | }, 103 | "value": "MyArg" 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArgReturnsNumber_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Запустить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] with [[argument]] and return Number-tag", 18 | "nl": "Voer [[code]] uit met [[argument]] en return Nummer-tag", 19 | "da": "Kør [[code]] med [[argument]] og returner Nummer-tag", 20 | "de": "Führen Sie [[code]] mit [[argument]] aus und geben Sie die Nummer-Taste zurück", 21 | "es": "Ejecutar [[code]] con [[argument]] y devolver la etiqueta de número", 22 | "fr": "Exécuter [[code]] avec [[argument]] et retourner l'étiquette Nombre", 23 | "it": "Esegui [[code]] con [[argument]] e restituisci il tag Numero", 24 | "no": "Kjør [[code]] med [[argument]] og returner Nummer-tag", 25 | "sv": "Kör [[code]] med [[argument]] och returnera Nummer-tagg", 26 | "pl": "Uruchom [[code]] z [[argument]] i zwróć Tag Numer", 27 | "ru": "Запуск [[code]] с [[argument]] и возврат тега Число", 28 | "ko": "[[argument]]와 함께 [[code]] 실행하고 숫자 태그 반환" 29 | }, 30 | "tokens": [ 31 | { 32 | "name": "number", 33 | "type": "number", 34 | "title": { 35 | "en": "Result", 36 | "nl": "Resultaat", 37 | "da": "Resultat", 38 | "de": "Ergebnis", 39 | "es": "Resultado", 40 | "fr": "Résultat", 41 | "it": "Risultato", 42 | "no": "Resultat", 43 | "sv": "Resultat", 44 | "pl": "Wynik", 45 | "ru": "Результат", 46 | "ko": "결과" 47 | } 48 | } 49 | ], 50 | "args": [ 51 | { 52 | "name": "code", 53 | "type": "code", 54 | "language": "homeyscript", 55 | "title": { 56 | "en": "Code", 57 | "nl": "Code", 58 | "da": "Kode", 59 | "de": "Code", 60 | "es": "Código", 61 | "fr": "Code", 62 | "it": "Codice", 63 | "no": "Kode", 64 | "sv": "Kod", 65 | "pl": "Kod", 66 | "ru": "Код", 67 | "ko": "코드" 68 | }, 69 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 1;" 70 | }, 71 | { 72 | "name": "argument", 73 | "type": "text", 74 | "required": false, 75 | "title": { 76 | "en": "Argument", 77 | "nl": "Argument", 78 | "da": "Argument", 79 | "de": "Argument", 80 | "es": "Argumento", 81 | "fr": "Argument", 82 | "it": "Argomento", 83 | "no": "Argument", 84 | "sv": "Argument", 85 | "pl": "Argument", 86 | "ru": "Аргумент", 87 | "ko": "인수" 88 | }, 89 | "placeholder": { 90 | "en": "Argument", 91 | "nl": "Argument", 92 | "da": "Argument", 93 | "de": "Argument", 94 | "es": "Argumento", 95 | "fr": "Argument", 96 | "it": "Argomento", 97 | "no": "Argument", 98 | "sv": "Argument", 99 | "pl": "Argument", 100 | "ru": "Аргумент", 101 | "ko": "인수" 102 | }, 103 | "value": "MyArg" 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArgReturnsString_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "en": "Run code", 4 | "nl": "Voer code uit", 5 | "da": "Kør kode", 6 | "de": "Code ausführen", 7 | "es": "Ejecutar código", 8 | "fr": "Exécuter le code", 9 | "it": "Esegui codice", 10 | "no": "Kjør kode", 11 | "sv": "Kör kod", 12 | "pl": "Uruchom kod", 13 | "ru": "Выполнить код", 14 | "ko": "코드 실행" 15 | }, 16 | "titleFormatted": { 17 | "en": "Run [[code]] with [[argument]] and return Text-tag", 18 | "nl": "Voer [[code]] uit met [[argument]] en return Tekst-tag", 19 | "da": "Kør [[code]] med [[argument]] og returner Tekst-tag", 20 | "de": "Führe [[code]] mit [[argument]] aus und gib Text-Tag zurück", 21 | "es": "Ejecutar [[code]] con [[argument]] y devolver etiqueta de texto", 22 | "fr": "Exécutez [[code]] avec [[argument]] et retournez l'étiquette texte", 23 | "it": "Esegui [[code]] con [[argument]] e restituisci etichetta di testo", 24 | "no": "Kjør [[code]] med [[argument]] og returner tekst-tag", 25 | "sv": "Kör [[code]] med [[argument]] och returnera text-tagg", 26 | "pl": "Uruchom [[code]] z [[argument]] i zwróć etykietę tekstową", 27 | "ru": "Выполнить [[code]] с [[argument]] и вернуть текстовый тег", 28 | "ko": "[[code]]을 [[argument]] 로 실행하고 텍스트 태그 반환" 29 | }, 30 | "tokens": [ 31 | { 32 | "name": "string", 33 | "type": "string", 34 | "title": { 35 | "en": "Result", 36 | "nl": "Resultaat", 37 | "da": "Resultat", 38 | "de": "Ergebnis", 39 | "es": "Resultado", 40 | "fr": "Résultat", 41 | "it": "Risultato", 42 | "no": "Resultat", 43 | "sv": "Resultat", 44 | "pl": "Wynik", 45 | "ru": "Результат", 46 | "ko": "결과" 47 | } 48 | } 49 | ], 50 | "args": [ 51 | { 52 | "name": "code", 53 | "type": "code", 54 | "language": "homeyscript", 55 | "title": { 56 | "en": "Code", 57 | "nl": "Code", 58 | "da": "Kode", 59 | "de": "Code", 60 | "es": "Código", 61 | "fr": "Code", 62 | "it": "Codice", 63 | "no": "Kode", 64 | "sv": "Kod", 65 | "pl": "Kod", 66 | "ru": "Код", 67 | "ko": "코드" 68 | }, 69 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 'Hello World!';" 70 | }, 71 | { 72 | "name": "argument", 73 | "type": "text", 74 | "required": false, 75 | "title": { 76 | "en": "Argument", 77 | "nl": "Argument", 78 | "da": "Argument", 79 | "de": "Argument", 80 | "es": "Argumento", 81 | "fr": "Argument", 82 | "it": "Argomento", 83 | "no": "Argument", 84 | "sv": "Argument", 85 | "pl": "Argument", 86 | "ru": "Аргумент", 87 | "ko": "인수" 88 | }, 89 | "placeholder": { 90 | "en": "Argument", 91 | "nl": "Argument", 92 | "da": "Argument", 93 | "de": "Argument", 94 | "es": "Argumento", 95 | "fr": "Argument", 96 | "it": "Argomento", 97 | "no": "Argument", 98 | "sv": "Argument", 99 | "pl": "Argument", 100 | "ru": "Аргумент", 101 | "ko": "인수" 102 | }, 103 | "value": "MyArg" 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArgReturnsBoolean.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] with [[argument]] and return Yes/No-tag", 19 | "nl": "Voer [[code]] uit met [[argument]] en return Ja/Nee-tag", 20 | "da": "Kør [[code]] med [[argument]] og returner Ja/Nej-tag", 21 | "de": "Führe [[code]] mit [[argument]] aus und gib Ja/Nein-Tag zurück", 22 | "es": "Ejecutar [[code]] con [[argument]] y devolver etiqueta Sí/No", 23 | "fr": "Exécuter [[code]] avec [[argument]] et retourner une étiquette Oui/Non", 24 | "it": "Esegui [[code]] con [[argument]] e restituisci tag Sì/No", 25 | "no": "Kjør [[code]] med [[argument]] og returner Ja/Nei-tag", 26 | "sv": "Kör [[code]] med [[argument]] och returnera Ja/Nej-tag", 27 | "pl": "Uruchom [[code]] z [[argument]] i zwróć tag Tak/Nie", 28 | "ru": "Запустите [[code]] с [[argument]] и верните тег Да/Нет", 29 | "ko": "[[argument]]와 함께 [[code]]를 실행하고 예/아니요 태그 반환" 30 | }, 31 | "tokens": [ 32 | { 33 | "name": "boolean", 34 | "type": "boolean", 35 | "title": { 36 | "en": "Result", 37 | "nl": "Resultaat", 38 | "da": "Resultat", 39 | "de": "Ergebnis", 40 | "es": "Resultado", 41 | "fr": "Résultat", 42 | "it": "Risultato", 43 | "no": "Resultat", 44 | "sv": "Resultat", 45 | "pl": "Wynik", 46 | "ru": "Результат", 47 | "ko": "결과" 48 | } 49 | } 50 | ], 51 | "args": [ 52 | { 53 | "name": "code", 54 | "type": "code", 55 | "language": "homeyscript", 56 | "title": { 57 | "en": "Code", 58 | "nl": "Code", 59 | "da": "Kode", 60 | "de": "Code", 61 | "es": "Código", 62 | "fr": "Code", 63 | "it": "Codice", 64 | "no": "Kode", 65 | "sv": "Kod", 66 | "pl": "Kod", 67 | "ru": "Код", 68 | "ko": "코드" 69 | }, 70 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 71 | }, 72 | { 73 | "name": "argument", 74 | "type": "text", 75 | "required": false, 76 | "title": { 77 | "en": "Argument", 78 | "nl": "Argument", 79 | "da": "Argument", 80 | "de": "Argument", 81 | "es": "Argumento", 82 | "fr": "Argument", 83 | "it": "Argomento", 84 | "no": "Argument", 85 | "sv": "Argument", 86 | "pl": "Argument", 87 | "ru": "Аргумент", 88 | "ko": "인수" 89 | }, 90 | "placeholder": { 91 | "en": "Argument", 92 | "nl": "Argument", 93 | "da": "Argument", 94 | "de": "Argument", 95 | "es": "Argumento", 96 | "fr": "Argument", 97 | "it": "Argomento", 98 | "no": "Argument", 99 | "sv": "Argument", 100 | "pl": "Argument", 101 | "ru": "Аргумент", 102 | "ko": "인수" 103 | }, 104 | "value": "MyArg" 105 | } 106 | ] 107 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArgReturnsNumber.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] with [[argument]] and return Number-tag", 19 | "nl": "Voer [[code]] uit met [[argument]] en return Nummer-tag", 20 | "da": "Kør [[code]] med [[argument]] og returner Number-tag", 21 | "de": "Führe [[code]] mit [[argument]] aus und gib Number-tag zurück", 22 | "es": "Ejecutar [[code]] con [[argument]] y devolver etiqueta de número", 23 | "fr": "Exécuter [[code]] avec [[argument]] et renvoyer une étiquette numérique", 24 | "it": "Esegui [[code]] con [[argument]] e restituisci il tag numero", 25 | "no": "Kjør [[code]] med [[argument]] og returner Nummer-tag", 26 | "sv": "Kör [[code]] med [[argument]] och returnera Num-mer-tag", 27 | "pl": "Uruchom [[code]] z [[argument]] i zwróć tag liczby", 28 | "ru": "Выполнить [[code]] с [[argument]] и вернуть Number-tag", 29 | "ko": "[[code]]를 [[argument]]와 함께 실행하고 Number-tag 반환" 30 | }, 31 | "tokens": [ 32 | { 33 | "name": "number", 34 | "type": "number", 35 | "title": { 36 | "en": "Result", 37 | "nl": "Resultaat", 38 | "da": "Resultat", 39 | "de": "Ergebnis", 40 | "es": "Resultado", 41 | "fr": "Résultat", 42 | "it": "Risultato", 43 | "no": "Resultat", 44 | "sv": "Resultat", 45 | "pl": "Wynik", 46 | "ru": "Результат", 47 | "ko": "결과" 48 | } 49 | } 50 | ], 51 | "args": [ 52 | { 53 | "name": "code", 54 | "type": "code", 55 | "language": "homeyscript", 56 | "title": { 57 | "en": "Code", 58 | "nl": "Code", 59 | "da": "Kode", 60 | "de": "Code", 61 | "es": "Código", 62 | "fr": "Code", 63 | "it": "Codice", 64 | "no": "Kode", 65 | "sv": "Kod", 66 | "pl": "Kod", 67 | "ru": "Код", 68 | "ko": "코드" 69 | }, 70 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 1;" 71 | }, 72 | { 73 | "name": "argument", 74 | "type": "text", 75 | "required": false, 76 | "title": { 77 | "en": "Argument", 78 | "nl": "Argument", 79 | "da": "Argument", 80 | "de": "Argument", 81 | "es": "Argumento", 82 | "fr": "Argument", 83 | "it": "Argomento", 84 | "no": "Argument", 85 | "sv": "Argument", 86 | "pl": "Argument", 87 | "ru": "Аргумент", 88 | "ko": "인수" 89 | }, 90 | "placeholder": { 91 | "en": "Argument", 92 | "nl": "Argument", 93 | "da": "Argument", 94 | "de": "Argument", 95 | "es": "Argumento", 96 | "fr": "Argument", 97 | "it": "Argomento", 98 | "no": "Argument", 99 | "sv": "Argument", 100 | "pl": "Argument", 101 | "ru": "Аргумент", 102 | "ko": "인수" 103 | }, 104 | "value": "MyArg" 105 | } 106 | ] 107 | } -------------------------------------------------------------------------------- /.homeycompose/flow/actions/runCodeWithArgReturnsString.json: -------------------------------------------------------------------------------- 1 | { 2 | "deprecated": true, 3 | "title": { 4 | "en": "Run code", 5 | "nl": "Voer code uit", 6 | "da": "Kør kode", 7 | "de": "Code ausführen", 8 | "es": "Ejecutar código", 9 | "fr": "Exécuter le code", 10 | "it": "Esegui codice", 11 | "no": "Kjør kode", 12 | "sv": "Kör kod", 13 | "pl": "Uruchom kod", 14 | "ru": "Запустить код", 15 | "ko": "코드 실행" 16 | }, 17 | "titleFormatted": { 18 | "en": "Run [[code]] with [[argument]] and return Text-tag", 19 | "nl": "Voer [[code]] uit met [[argument]] en return Tekst-tag", 20 | "da": "Kør [[code]] med [[argument]] og returner tekst-tag", 21 | "de": "Führen Sie [[code]] mit [[argument]] aus und geben Sie Text-Tag zurück", 22 | "es": "Ejecuta [[code]] con [[argument]] y devuelve la etiqueta de texto", 23 | "fr": "Exécutez [[code]] avec [[argument]] et renvoyez une balise texte", 24 | "it": "Esegui [[code]] con [[argument]] e restituisci il tag di testo", 25 | "no": "Kjør [[code]] med [[argument]] og returner tekst-etikett", 26 | "sv": "Kör [[code]] med [[argument]] och returnera texttagg", 27 | "pl": "Uruchom [[code]] z [[argument]] i zwróć znacznik tekstowy", 28 | "ru": "Запустите [[code]] с [[argument]] и верните текстовый тег", 29 | "ko": "[[code]]를 [[argument]]로 실행하고 텍스트 태그 반환" 30 | }, 31 | "tokens": [ 32 | { 33 | "name": "string", 34 | "type": "string", 35 | "title": { 36 | "en": "Result", 37 | "nl": "Resultaat", 38 | "da": "Resultat", 39 | "de": "Ergebnis", 40 | "es": "Resultado", 41 | "fr": "Résultat", 42 | "it": "Risultato", 43 | "no": "Resultat", 44 | "sv": "Resultat", 45 | "pl": "Wynik", 46 | "ru": "Результат", 47 | "ko": "결과" 48 | } 49 | } 50 | ], 51 | "args": [ 52 | { 53 | "name": "code", 54 | "type": "code", 55 | "language": "homeyscript", 56 | "title": { 57 | "en": "Code", 58 | "nl": "Code", 59 | "da": "Kode", 60 | "de": "Code", 61 | "es": "Código", 62 | "fr": "Code", 63 | "it": "Codice", 64 | "no": "Kode", 65 | "sv": "Kod", 66 | "pl": "Kod", 67 | "ru": "Код", 68 | "ko": "코드" 69 | }, 70 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 'Hello World!';" 71 | }, 72 | { 73 | "name": "argument", 74 | "type": "text", 75 | "required": false, 76 | "title": { 77 | "en": "Argument", 78 | "nl": "Argument", 79 | "da": "Argument", 80 | "de": "Argument", 81 | "es": "Argumento", 82 | "fr": "Argument", 83 | "it": "Argomento", 84 | "no": "Argument", 85 | "sv": "Argument", 86 | "pl": "Argument", 87 | "ru": "Аргумент", 88 | "ko": "인수" 89 | }, 90 | "placeholder": { 91 | "en": "Argument", 92 | "nl": "Argument", 93 | "da": "Argument", 94 | "de": "Argument", 95 | "es": "Argumento", 96 | "fr": "Argument", 97 | "it": "Argomento", 98 | "no": "Argument", 99 | "sv": "Argument", 100 | "pl": "Argument", 101 | "ru": "Аргумент", 102 | "ko": "인수" 103 | }, 104 | "value": "MyArg" 105 | } 106 | ] 107 | } -------------------------------------------------------------------------------- /docs/api.js: -------------------------------------------------------------------------------- 1 | /** 2 | * All properties & methods in this namespace are accessible in a HomeyScript. 3 | * 4 | * @namespace global 5 | * @example 6 | * // Get all devices 7 | * const devices = await Homey.devices.getDevices(); 8 | * 9 | * // Loop over all devices 10 | * for (const device of Object.values(devices)) { 11 | * 12 | * // If this device is a light (class) 13 | * // Or this is a 'What's plugged in?'-light (virtualClass) 14 | * if (device.class === 'light' || device.virtualClass === 'light') { 15 | * log(`\nTurning '${device.name}' on...`); 16 | * 17 | * // Turn the light on by setting the capability `onoff` to `true` 18 | * await device.setCapabilityValue('onoff', true) 19 | * .then(() => log('OK')) 20 | * .catch(error => log(`Error:`, error)); 21 | * } 22 | * } 23 | */ 24 | 25 | /** 26 | * Log to the console. 27 | * @memberof global 28 | * @async 29 | * @function log 30 | * @param {...Mixed} arg1 31 | * @example 32 | * log('Hello World!'); 33 | */ 34 | 35 | /** 36 | * Says something over the internal speaker. 37 | * @memberof global 38 | * @async 39 | * @function say 40 | * @param {String} text 41 | * @example 42 | * await say('Hello world!'); 43 | */ 44 | 45 | /** 46 | * Creates or updates a Flow Tag. These are persistent across reboots. 47 | * 48 | * Delete a Flow Tag by providing `null` as value. 49 | * @memberof global 50 | * @async 51 | * @function tag 52 | * @param {String} id ID of the Tag 53 | * @param {String|Number|Boolean|null} value Value of the Tag 54 | * @example 55 | * await tag('My Tag', 1337); // Create 56 | * await tag('My Tag', 1338); // Update 57 | * await tag('My Tag', null); // Delete 58 | */ 59 | 60 | /** 61 | * Resolves after `milliseconds` milliseconds. 62 | * 63 | * @memberof global 64 | * @async 65 | * @function wait 66 | * @param {Number} milliseconds 67 | * @example 68 | * log('Foo'); 69 | * await wait(1000); 70 | * log('Bar'); 71 | */ 72 | 73 | /** 74 | * A [HomeyAPI](https://athombv.github.io/node-homey-api/HomeyAPIV2.html) instance. 75 | * 76 | * @memberof global 77 | * @member {HomeyAPI} Homey 78 | * @example 79 | * const devices = await Homey.devices.getDevices(); 80 | */ 81 | 82 | /** 83 | * Shortcut to [node-fetch](https://www.npmjs.com/package/node-fetch/v/2.6.7). 84 | * 85 | * @memberof global 86 | * @async 87 | * @function fetch 88 | * @param {String} url 89 | * @param {Object} options 90 | */ 91 | 92 | /** 93 | * Shortcut to [lodash](https://www.npmjs.com/package/lodash). 94 | * 95 | * @memberof global 96 | * @member {Object} _ 97 | */ 98 | 99 | /** 100 | * Provided arguments to this script. 101 | * 102 | * @memberof global 103 | * @member {Array} args 104 | * @example 105 | * log(args[0]); // "myArgument" 106 | */ 107 | 108 | /** 109 | * Shortcut to [Buffer](https://nodejs.org/api/buffer.html). 110 | * 111 | * @memberof global 112 | * @member {Object} Buffer 113 | */ 114 | 115 | /** 116 | * Shortcut to [URLSearchParams](https://nodejs.org/api/url.html#class-urlsearchparams). 117 | * 118 | * @memberof global 119 | * @member {Class} URLSearchParams 120 | */ 121 | 122 | /** 123 | * Shortcut to [http](https://nodejs.org/api/http.html). 124 | * 125 | * @memberof global 126 | * @member {Object} http 127 | */ 128 | 129 | /** 130 | * Shortcut to [https](https://nodejs.org/api/https.html). 131 | * 132 | * @memberof global 133 | * @member {Object} https 134 | */ 135 | 136 | /** 137 | * The filename of the HomeyScript. 138 | * 139 | * @memberof global 140 | * @member {String} __filename__ 141 | */ 142 | 143 | /** 144 | * The Script ID of the HomeyScript. 145 | * 146 | * @memberof global 147 | * @member {String} __script_id__ 148 | */ 149 | 150 | /** 151 | * When the HomeyScript has last executed. 152 | * 153 | * @memberof global 154 | * @member {Date} __last_executed__ 155 | */ 156 | 157 | /** 158 | * Milliseconds since the HomeyScript has last executed. 159 | * 160 | * @memberof global 161 | * @member {Number} __ms_since_last_executed__ 162 | */ 163 | 164 | /** 165 | * Get a global value that's accessible between HomeyScripts. 166 | * 167 | * @memberof global 168 | * @function global.get 169 | * @param {String} key Key of the property 170 | */ 171 | 172 | /** 173 | * Set a global value that's accessible between HomeyScripts. 174 | * 175 | * @memberof global 176 | * @function global.set 177 | * @param {String} key Key of the property 178 | * @param {Mixed} value Value of the property 179 | */ 180 | 181 | /** 182 | * Gets all keys of global values. 183 | * 184 | * @memberof global 185 | * @function global.keys 186 | * @returns {Array} 187 | */ 188 | -------------------------------------------------------------------------------- /docs/tutorials/migrate.md: -------------------------------------------------------------------------------- 1 | To create a unified API for all our products we decided to introduce [homey-api](https://www.npmjs.com/package/homey-api) as the successor to [athom-api](https://www.npmjs.com/package/athom-api). New HomeyScript's will automatically use the new API under the same global variable [`Homey`](./global#.Homey). 2 | 3 | **Editor Scripts** - [https://my.homey.app/scripts/](https://my.homey.app/scripts/) 4 | 5 | All scripts that use the deprecated API will still work but will have a yellow indicator that tells you that it is using the deprecated API version. If your scripts are not using the global Homey API object there is no need to change the code. 6 | 7 | To use the new API you have to create a new script and copy over the previous code and change it according to the steps below. 8 | 9 | **Advanced FlowCards** 10 | 11 | All Advanced FlowCards that used the inline code editor have been deprecated. To use the new API the same Advanced FlowCard must be added again and the current code can be copied over and changed according the the steps below. The deprecated cards will still work and keep working so if the global Homey API object is not used there is no need to change the code. 12 | 13 | To convert scripts to the new API, you can use the following steps: 14 | 15 | ## Step 1 - Devices 16 | 17 | For a device the `driverUri` and `zoneName` properties have been removed. The `driverUri` is now part of the `driverId` and the `zoneName` has to be fetched based on the `zone` property of the device. 18 | 19 | ```javascript 20 | let deviceZone = await device.getZone(); 21 | 22 | // Or 23 | deviceZone = await Homey.zones.getZone({ id: device.zone }); 24 | 25 | // Or 26 | const zones = await Homey.zones.getZones(); 27 | 28 | deviceZone = zones[device.zone]; 29 | const zoneName = deviceZone ? deviceZone.name : 'Missing Zone'; 30 | ``` 31 | 32 | ## Step 2 - FlowCards 33 | 34 | The calls to `Homey.flow.getFlowCardTriggers`, `Homey.flow.getFlowCardConditions` and `Homey.flow.getFlowCardActions` now all return an object with key value pairs instead of an array. 35 | 36 | ```javascript 37 | // The following code changes from: 38 | const conditionCards = await Homey.flow.getFlowCardConditions(); 39 | for (const card of conditionCards) { 40 | // ... 41 | } 42 | 43 | // To: 44 | const conditionCards = await Homey.flow.getFlowCardConditions(); 45 | for (const card of Object.values(conditionCards)) { 46 | // ... 47 | } 48 | ``` 49 | 50 | The cards can be referenced by the `card.id` property. This is also the key of the card in the collection. 51 | 52 | ```javascript 53 | const conditionCards = await Homey.flow.getFlowCardConditions(); 54 | for (const card of Object.values(conditionCards)) { 55 | console.log(conditionCards[card.id] === card); 56 | } 57 | ``` 58 | 59 | The property `uriObj` has been removed. Before this would contain some properties of the owner of the card. For example if the card belonged to a device it would contain the device name and the icon. 60 | 61 | Now you must fetch the device to which the card belongs. Since the id of a card will always be of the format ``homey:::``. It's easy to get the device from the `Homey.devices.getDevices` call and find the `ownerId` or pass the `ownerId` to the `devices.getDevice` call. 62 | 63 | ```javascript 64 | const [, ownerType, ownerId, cardId] = card.id.split(':'); 65 | 66 | if (ownerType === 'device') { 67 | const devices = await Homey.devices.getDevices(); 68 | console.log(devices[ownerId]); 69 | 70 | // Or 71 | const device = await Homey.devices.getDevice({ id: ownerId }); 72 | } 73 | ``` 74 | 75 | Calls to `Homey.flow.runFlowCardCondition` and `Homey.flow.runFlowCardAction` no longer require the card `uri` as a parameter. 76 | 77 | ```javascript 78 | // The following code changes from: 79 | await Homey.flow.runFlowCardAction({ uri: card.uri, id: card.id, args: { ... } }); 80 | 81 | // To: 82 | await Homey.flow.runFlowCardAction({ id: card.id, args: { ... } }); 83 | ``` 84 | 85 | ## Step 3 - Insights 86 | The `uriObj` property has been deleted from a Log as returned by [`Homey.insights.getLogs()`](https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerInsights.html#getLogs) the owner must be matched the same way as with FlowCards. 87 | 88 | ## Step 4 - FlowToken 89 | The `uriObj` property has been deleted from a FlowToken as returned by [`Homey.flowtoken.getFlowTokens()`](https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerFlowToken.html#getFlowTokens) the owner must be matched the same way as with FlowCards. 90 | 91 | ## Step 5 - Drivers 92 | The `uriObj` property has been deleted from a Driver as returned by [`Homey.drivers.getDrivers()`](https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDrivers.html#getDrivers). The icon can now be found under `driver.ownerIconObj` and the color under `driver.color`. 93 | 94 | ## Step 6 - Apps 95 | The following endpoints on the [`App`](https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerApps.App.html) class have been renamed. 96 | 97 | - `app.apiGet(path)` -> `app.get({ path })` 98 | 99 | - `app.apiPost(path, body)` -> `app.post({ path, body })` 100 | 101 | - `app.apiPut(path, body)` -> `app.put({ path, body })` 102 | 103 | - `app.apiDelete(path)` -> `app.delete({ path })` 104 | 105 | ## Step 7 - Managers 106 | 107 | `Homey.zigBee` has been renamed to `Homey.zigbee`. 108 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const fs = require('fs').promises; 4 | const vm = require('vm'); 5 | const util = require('util'); 6 | const path = require('path'); 7 | const http = require('http'); 8 | const https = require('https'); 9 | const uuid = require('uuid'); 10 | 11 | const Homey = require('homey'); 12 | const { HomeyAPI: HomeyAPILegacy } = require('athom-api'); 13 | const { HomeyAPIV2, HomeyAPIV3Local } = require('homey-api'); 14 | const fetch = require('node-fetch'); 15 | const _ = require('lodash'); 16 | 17 | const { RunCondition } = require('./lib/flow/conditions/RunCondition'); 18 | const { RunWithArgCondition } = require('./lib/flow/conditions/RunWithArgCondition'); 19 | const { RunCodeCondition } = require('./lib/flow/conditions/RunCodeCondition'); 20 | const { RunCodeWithArgCondition } = require('./lib/flow/conditions/RunCodeWithArgCondition'); 21 | 22 | const { RunAction } = require('./lib/flow/actions/RunAction'); 23 | const { RunCodeAction } = require('./lib/flow/actions/RunCodeAction'); 24 | const { RunWithArgAction } = require('./lib/flow/actions/RunWithArgAction'); 25 | const { RunCodeReturnsStringAction } = require('./lib/flow/actions/RunCodeReturnsStringAction'); 26 | const { RunCodeReturnsNumberAction } = require('./lib/flow/actions/RunCodeReturnsNumberAction'); 27 | const { RunCodeReturnsBooleanAction } = require('./lib/flow/actions/RunCodeReturnsBooleanAction'); 28 | const { RunCodeWithArgAction } = require('./lib/flow/actions/RunCodeWithArgAction'); 29 | const { RunCodeWithArgReturnsStringAction } = require('./lib/flow/actions/RunCodeWithArgReturnsStringAction'); 30 | const { RunCodeWithArgReturnsNumberAction } = require('./lib/flow/actions/RunCodeWithArgReturnsNumberAction'); 31 | const { RunCodeWithArgReturnsBooleanAction } = require('./lib/flow/actions/RunCodeWithArgReturnsBooleanAction'); 32 | 33 | module.exports = class HomeyScriptApp extends Homey.App { 34 | 35 | static RUN_TIMEOUT = 1000 * 30; // 30s 36 | 37 | async onInit() { 38 | // Remove since alot of them will be caused by user errors. 39 | process.removeAllListeners('unhandledRejection'); 40 | 41 | process.on('unhandledRejection', (reason, promise) => { 42 | this.error('Unhandled Rejection:', reason); 43 | }); 44 | 45 | // Init Scripts 46 | this.scripts = this.homey.settings.get('scripts'); 47 | 48 | this.localUrl = await this.homey.api.getLocalUrl(); 49 | this.sessionToken = await this.homey.api.getOwnerApiToken(); 50 | 51 | this.apiProps = await (async () => { 52 | const props = { 53 | token: this.sessionToken, 54 | baseUrl: this.localUrl, 55 | strategy: [], 56 | properties: { 57 | id: await this.homey.cloud.getHomeyId(), 58 | softwareVersion: this.homey.version, 59 | }, 60 | }; 61 | 62 | return props; 63 | })(); 64 | 65 | const exampleFolder = this.homey.platformVersion >= 2 ? 'examples' : 'examples-v1'; 66 | 67 | if (!this.scripts) { 68 | this.log('No scripts found.'); 69 | 70 | const scripts = {}; 71 | 72 | // Copy example scripts 73 | try { 74 | const files = await fs.readdir(path.join(__dirname, exampleFolder)); 75 | await Promise.all(files.map(async filename => { 76 | if (!filename.endsWith('.js')) return; 77 | 78 | const id = `example-${filename.substring(0, filename.length - '.js'.length)}`; 79 | const filepath = path.join(__dirname, exampleFolder, filename); 80 | const code = await fs.readFile(filepath, 'utf8'); 81 | 82 | scripts[id] = { 83 | code, 84 | lastExecuted: null, 85 | version: 2, 86 | }; 87 | 88 | this.log(`Found Example: ${id}`); 89 | })); 90 | } catch (err) { 91 | this.error('Examples Error:', err); 92 | } 93 | 94 | // Check for existing (SDK2) scripts in /userdata 95 | try { 96 | const files = await fs.readdir(path.join(__dirname, 'userdata', 'scripts')); 97 | await Promise.all(files.map(async filename => { 98 | if (!filename.endsWith('.js')) return; 99 | 100 | const id = filename.substring(0, filename.length - '.js'.length); 101 | const filepath = path.join(__dirname, 'userdata', 'scripts', filename); 102 | const code = await fs.readFile(filepath, 'utf8'); 103 | 104 | scripts[id] = { 105 | code, 106 | lastExecuted: new Date(this.homey.settings.get(`last-execution-${id}`)), 107 | }; 108 | 109 | this.log(`Found Migration: ${id}`); 110 | })); 111 | } catch (err) { 112 | this.error('Migration Error:', err); 113 | } 114 | 115 | this.scripts = scripts; 116 | this.homey.settings.set('scripts', this.scripts); 117 | } 118 | 119 | // Migration 120 | if (this.scripts) { 121 | const scriptEntries = Object.entries(this.scripts); 122 | let anyScriptChanged = false; 123 | 124 | for (const [scriptId, script] of scriptEntries) { 125 | if (typeof script.name !== 'string') { 126 | anyScriptChanged = true; 127 | script.name = scriptId; 128 | script.id = scriptId; 129 | } 130 | 131 | if (typeof script.version !== 'number') { 132 | anyScriptChanged = true; 133 | script.version = 1; 134 | } 135 | } 136 | 137 | if (anyScriptChanged) { 138 | this.homey.settings.set('scripts', this.scripts); 139 | } 140 | } 141 | 142 | // Register Flow Cards 143 | this.runCondition = new RunCondition({ homey: this.homey }); 144 | this.runWithArgCondition = new RunWithArgCondition({ homey: this.homey }); 145 | this.runCodeCondition = new RunCodeCondition({ homey: this.homey }); 146 | this.runCodeWithArgCondition = new RunCodeWithArgCondition({ homey: this.homey }); 147 | 148 | this.runAction = new RunAction({ homey: this.homey }); 149 | this.runWithArgAction = new RunWithArgAction({ homey: this.homey }); 150 | this.runCodeAction = new RunCodeAction({ homey: this.homey }); 151 | this.runCodeReturnsStringAction = new RunCodeReturnsStringAction({ homey: this.homey }); 152 | this.runCodeReturnsNumberAction = new RunCodeReturnsNumberAction({ homey: this.homey }); 153 | this.runCodeReturnsBooleanAction = new RunCodeReturnsBooleanAction({ homey: this.homey }); 154 | this.runCodeWithArgAction = new RunCodeWithArgAction({ homey: this.homey }); 155 | this.runCodeWithArgReturnsStringAction = new RunCodeWithArgReturnsStringAction({ homey: this.homey }); 156 | this.runCodeWithArgReturnsNumberAction = new RunCodeWithArgReturnsNumberAction({ homey: this.homey }); 157 | this.runCodeWithArgReturnsBooleanAction = new RunCodeWithArgReturnsBooleanAction({ homey: this.homey }); 158 | 159 | // Register Flow Tokens 160 | this.tokens = this.homey.settings.get('tokens') || {}; 161 | this.tokensInstances = {}; 162 | 163 | await Promise.all(Object.keys(this.tokens).map(async id => { 164 | this.tokensInstances[id] = await this.homey.flow.createToken(id, { 165 | title: id, 166 | type: this.tokens[id].type, 167 | value: this.tokens[id].value, 168 | }); 169 | })).catch(this.error); 170 | } 171 | 172 | createAppApi() { 173 | if (this.homey.platform === 'local' && this.homey.platformVersion === 1) { 174 | return new HomeyAPIV2(this.apiProps); 175 | } 176 | 177 | if (this.homey.platform === 'local' && this.homey.platformVersion >= 2) { 178 | return new HomeyAPIV3Local(this.apiProps); 179 | } 180 | 181 | throw new Error('Not Supported'); 182 | } 183 | 184 | getHomeyAPI({ version }) { 185 | if (version >= 2) { 186 | const api = this.createAppApi(); 187 | return api; 188 | } 189 | 190 | const api = new HomeyAPILegacy({ 191 | localUrl: this.localUrl, 192 | baseUrl: this.localUrl, 193 | token: this.sessionToken, 194 | apiVersion: 2, 195 | online: true, 196 | }, () => { 197 | // called by HomeyAPI on 401 requests 198 | api.setToken(this.sessionToken); 199 | }); 200 | 201 | return api; 202 | } 203 | 204 | async onFlowGetScriptAutocomplete(query) { 205 | const scripts = await this.getScripts(); 206 | 207 | return Object.values(scripts) 208 | .filter(script => script.name.toLowerCase().includes(query.toLowerCase())) 209 | .map(script => ({ 210 | id: script.id, 211 | name: script.name, 212 | })); 213 | } 214 | 215 | async setToken({ id, value, type = typeof value }) { 216 | // Delete the Token 217 | if (typeof value === 'undefined' || value === null) { 218 | if (this.tokensInstances[id]) { 219 | await this.tokensInstances[id].unregister().catch(this.error); 220 | } 221 | 222 | if (this.tokens[id]) { 223 | delete this.tokens[id]; 224 | delete this.tokensInstances[id]; 225 | this.homey.settings.set('tokens', this.tokens); 226 | } 227 | 228 | return; 229 | } 230 | 231 | // Create the Token 232 | if (!this.tokensInstances[id]) { 233 | this.tokensInstances[id] = await this.homey.flow.createToken(id, { 234 | type, 235 | value, 236 | title: id, 237 | }); 238 | 239 | this.tokens[id] = { type, value }; 240 | this.homey.settings.set('tokens', this.tokens); 241 | 242 | return; 243 | } 244 | 245 | // Update the Token 246 | if (this.tokensInstances[id]) { 247 | await this.tokensInstances[id].setValue(value); 248 | 249 | this.tokens[id].value = value; 250 | this.homey.settings.set('tokens', this.tokens); 251 | } 252 | } 253 | 254 | async getScripts() { 255 | return this.scripts; 256 | } 257 | 258 | async getScript({ id }) { 259 | const script = this.scripts[id]; 260 | 261 | if (!script) { 262 | throw new Error('Script Not Found'); 263 | } 264 | 265 | return { 266 | ...script, 267 | lastExecuted: new Date(script.lastExecuted), 268 | }; 269 | } 270 | 271 | async runScript({ 272 | id, 273 | name, 274 | code, 275 | lastExecuted, 276 | args = [], 277 | version, 278 | realtime = true, 279 | }) { 280 | if (lastExecuted == null) lastExecuted = new Date(); 281 | 282 | const homeyAPI = this.getHomeyAPI({ version }); 283 | 284 | // Create a Logger 285 | const log = (...props) => { 286 | this.log(`[${name}]`, ...props); 287 | 288 | if (realtime) { 289 | this.homey.api.realtime('log', { 290 | text: util.format(...props), 291 | script: id, 292 | }); 293 | } 294 | }; 295 | 296 | // Create the Context 297 | const context = vm.createContext({ 298 | args, 299 | 300 | // 3rd party modules 301 | _, 302 | fetch, 303 | http, 304 | https, 305 | URLSearchParams, 306 | Buffer, 307 | 308 | // System 309 | __filename__: `${name}.js`, 310 | __script_id__: id, 311 | __last_executed__: lastExecuted, 312 | __ms_since_last_executed__: Date.now() - lastExecuted.getTime(), 313 | 314 | // Homey API 315 | Homey: homeyAPI, 316 | 317 | // Logging 318 | log, 319 | console: { 320 | log, 321 | error: log, 322 | info: log, 323 | }, 324 | 325 | // Shortcuts 326 | say: async text => homeyAPI.speechOutput.say({ text }), 327 | tag: async (id, value) => this.setToken({ id, value }), 328 | wait: async delay => new Promise(resolve => setTimeout(resolve, delay)), 329 | 330 | // Cross-Script Settings 331 | global: { 332 | get: key => this.homey.settings.get(`homeyscript-${key}`), 333 | set: (key, value) => this.homey.settings.set(`homeyscript-${key}`, value), 334 | keys: () => this.homey.settings.getKeys() 335 | .filter(key => key.startsWith('homeyscript-')) 336 | .map(key => key.substring('homeyscript-'.length)), 337 | }, 338 | 339 | // Deprecated 340 | setTagValue: async (id, opts, value) => { 341 | log('Warning: setTagValue(id, opts, value) is deprecated, please use tag(id, value)'); 342 | await this.setToken({ 343 | id, 344 | value, 345 | type: opts.type, 346 | }); 347 | }, 348 | }); 349 | 350 | try { 351 | // Create the Sandbox 352 | const sandbox = new vm.Script(`Promise.resolve().then(async () => {\n${code}\n});`, { 353 | filename: `${name}.js`, 354 | lineOffset: -1, 355 | columnOffset: 0, 356 | }); 357 | 358 | const runPromise = sandbox.runInNewContext(context, { 359 | displayErrors: true, 360 | timeout: this.constructor.RUN_TIMEOUT, 361 | microtaskMode: 'afterEvaluate', // from Node 14 should properly timeout async script 362 | }); 363 | 364 | const result = await runPromise; 365 | log('\n———————————————————\n✅ Script Success\n'); 366 | log('↩️ Returned:', JSON.stringify(result, false, 2)); 367 | return result; 368 | } catch (err) { 369 | log('\n———————————————————\n❌ Script Error\n'); 370 | log('⚠️', err.stack); 371 | // Create a new Error because an Error from the sandbox behaves differently 372 | const error = new Error(err.message); 373 | error.stack = err.stack; 374 | throw error; 375 | } finally { 376 | if (homeyAPI) { 377 | homeyAPI.destroy(); 378 | } 379 | } 380 | } 381 | 382 | async createScript({ name, code }) { 383 | const newScript = { 384 | id: uuid.v4(), 385 | name, 386 | code, 387 | version: 2, 388 | lastExecuted: null, 389 | }; 390 | 391 | this.scripts[newScript.id] = newScript; 392 | this.homey.settings.set('scripts', this.scripts); 393 | 394 | return newScript; 395 | } 396 | 397 | async updateScript({ 398 | id, name, code, lastExecuted, version, 399 | }) { 400 | this.scripts[id] = { 401 | ...this.scripts[id], 402 | }; 403 | 404 | if (name != null) { 405 | this.scripts[id].name = name; 406 | } 407 | 408 | if (code != null) { 409 | this.scripts[id].code = code; 410 | } 411 | 412 | if (lastExecuted != null) { 413 | this.scripts[id].lastExecuted = lastExecuted; 414 | } 415 | 416 | if (version != null) { 417 | this.scripts[id].version = version; 418 | } 419 | 420 | this.homey.settings.set('scripts', this.scripts); 421 | 422 | return this.scripts[id]; 423 | } 424 | 425 | async deleteScript({ id }) { 426 | delete this.scripts[id]; 427 | this.homey.settings.set('scripts', this.scripts); 428 | } 429 | 430 | }; 431 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "This file is generated. Please edit .homeycompose/app.json instead.", 3 | "id": "com.athom.homeyscript", 4 | "sdk": 3, 5 | "version": "3.6.0", 6 | "compatibility": ">=5.0.0", 7 | "name": { 8 | "en": "HomeyScript", 9 | "nl": "HomeyScript", 10 | "da": "HomeyScript", 11 | "de": "HomeyScript", 12 | "es": "HomeyScript", 13 | "fr": "HomeyScript", 14 | "it": "HomeyScript", 15 | "no": "HomeyScript", 16 | "sv": "HomeyScript", 17 | "pl": "HomeyScript", 18 | "ru": "HomeyScript", 19 | "ko": "HomeyScript" 20 | }, 21 | "brandColor": "#2B1F32", 22 | "description": { 23 | "en": "Script your Home", 24 | "nl": "Script je Huis", 25 | "da": "Skript dit Hjem", 26 | "de": "Skripte dein Zuhause", 27 | "es": "Escribe un guión para tu hogar", 28 | "fr": "Script ton Domicile", 29 | "it": "Scriptare la tua Casa", 30 | "no": "Skript ditt Hjem", 31 | "sv": "Script ditt Hem", 32 | "pl": "Skryptuj Swój Dom", 33 | "ru": "Скрипт твоего Дома", 34 | "ko": "당신의 집을 스크립트로 작성하세요" 35 | }, 36 | "permissions": [ 37 | "homey:manager:api" 38 | ], 39 | "category": "tools", 40 | "author": { 41 | "name": "Athom B.V." 42 | }, 43 | "images": { 44 | "xlarge": "/assets/images/xlarge.png", 45 | "large": "/assets/images/large.png", 46 | "small": "/assets/images/small.png" 47 | }, 48 | "homepage": "https://my.homey.app/scripts", 49 | "support": "https://github.com/athombv/com.athom.homeyscript#disclaimer", 50 | "source": "https://github.com/athombv/com.athom.homeyscript", 51 | "platforms": [ 52 | "local" 53 | ], 54 | "api": { 55 | "getScripts": { 56 | "method": "get", 57 | "path": "/script" 58 | }, 59 | "getScript": { 60 | "method": "get", 61 | "path": "/script/:id" 62 | }, 63 | "runScript": { 64 | "method": "post", 65 | "path": "/script/:id/run" 66 | }, 67 | "createScript": { 68 | "method": "post", 69 | "path": "/script" 70 | }, 71 | "updateScript": { 72 | "method": "put", 73 | "path": "/script/:id" 74 | }, 75 | "deleteScript": { 76 | "method": "delete", 77 | "path": "/script/:id" 78 | } 79 | }, 80 | "flow": { 81 | "conditions": [ 82 | { 83 | "title": { 84 | "en": "Run a script", 85 | "nl": "Voer een script uit", 86 | "da": "Kør et script", 87 | "de": "Ein Skript ausführen", 88 | "es": "Ejecutar un script", 89 | "fr": "Exécuter un script", 90 | "it": "Esegui uno script", 91 | "no": "Kjør et skript", 92 | "sv": "Kör ett skript", 93 | "pl": "Uruchom skrypt", 94 | "ru": "Запустить скрипт", 95 | "ko": "스크립트 실행" 96 | }, 97 | "titleFormatted": { 98 | "en": "Run [[script]]", 99 | "nl": "Voer [[script]] uit", 100 | "da": "Kør [[script]]", 101 | "de": "Führe [[script]] aus", 102 | "es": "Ejecutar [[script]]", 103 | "fr": "Exécuter [[script]]", 104 | "it": "Esegui [[script]]", 105 | "no": "Kjør [[script]]", 106 | "sv": "Kör [[script]]", 107 | "pl": "Uruchom [[script]]", 108 | "ru": "Запустить [[script]]", 109 | "ko": "[[script]] 실행" 110 | }, 111 | "args": [ 112 | { 113 | "name": "script", 114 | "type": "autocomplete", 115 | "title": { 116 | "en": "Script", 117 | "nl": "Script", 118 | "da": "Skript", 119 | "de": "Skript", 120 | "es": "Script", 121 | "fr": "Script", 122 | "it": "Script", 123 | "no": "Skript", 124 | "sv": "Skript", 125 | "pl": "Skrypt", 126 | "ru": "Скрипт", 127 | "ko": "스크립트" 128 | } 129 | } 130 | ], 131 | "id": "run" 132 | }, 133 | { 134 | "deprecated": true, 135 | "title": { 136 | "en": "Run code", 137 | "nl": "Voer code uit", 138 | "da": "Kør kode", 139 | "de": "Code ausführen", 140 | "es": "Ejecutar código", 141 | "fr": "Exécuter le code", 142 | "it": "Esegui codice", 143 | "no": "Kjør kode", 144 | "sv": "Kör kod", 145 | "pl": "Uruchom kod", 146 | "ru": "Запустить код", 147 | "ko": "코드 실행" 148 | }, 149 | "titleFormatted": { 150 | "en": "Run [[code]]", 151 | "nl": "Voer [[code]] uit", 152 | "da": "Kør [[code]]", 153 | "de": "Führen Sie [[code]] aus", 154 | "es": "Ejecutar [[code]]", 155 | "fr": "Exécuter [[code]]", 156 | "it": "Esegui [[code]]", 157 | "no": "Kjør [[code]]", 158 | "sv": "Kör [[code]]", 159 | "pl": "Uruchom [[code]]", 160 | "ru": "Запустить [[code]]", 161 | "ko": "[[code]] 실행" 162 | }, 163 | "advanced": true, 164 | "args": [ 165 | { 166 | "name": "code", 167 | "type": "code", 168 | "language": "homeyscript", 169 | "title": { 170 | "en": "Code", 171 | "nl": "Code", 172 | "da": "Kode", 173 | "de": "Code", 174 | "es": "Código", 175 | "fr": "Code", 176 | "it": "Codice", 177 | "no": "Kode", 178 | "sv": "Kod", 179 | "pl": "Kod", 180 | "ru": "Код", 181 | "ko": "코드" 182 | }, 183 | "value": "// My Code\n\nreturn true;" 184 | } 185 | ], 186 | "id": "runCode" 187 | }, 188 | { 189 | "title": { 190 | "en": "Run code", 191 | "nl": "Voer code uit", 192 | "da": "Kør kode", 193 | "de": "Code ausführen", 194 | "es": "Ejecutar código", 195 | "fr": "Exécuter le code", 196 | "it": "Esegui codice", 197 | "no": "Kjør kode", 198 | "sv": "Kör kod", 199 | "pl": "Uruchom kod", 200 | "ru": "Запустить код", 201 | "ko": "코드 실행" 202 | }, 203 | "titleFormatted": { 204 | "en": "Run [[code]]", 205 | "nl": "Voer [[code]] uit", 206 | "da": "Kør [[code]]", 207 | "de": "Führen Sie [[code]] aus", 208 | "es": "Ejecutar [[code]]", 209 | "fr": "Exécuter [[code]]", 210 | "it": "Esegui [[code]]", 211 | "no": "Kjør [[code]]", 212 | "sv": "Kör [[code]]", 213 | "pl": "Uruchom [[code]]", 214 | "ru": "Запустить [[code]]", 215 | "ko": "[[code]] 실행" 216 | }, 217 | "advanced": true, 218 | "args": [ 219 | { 220 | "name": "code", 221 | "type": "code", 222 | "language": "homeyscript", 223 | "title": { 224 | "en": "Code", 225 | "nl": "Code", 226 | "da": "Kode", 227 | "de": "Code", 228 | "es": "Código", 229 | "fr": "Code", 230 | "it": "Codice", 231 | "no": "Kode", 232 | "sv": "Kod", 233 | "pl": "Kod", 234 | "ru": "Код", 235 | "ko": "코드" 236 | }, 237 | "value": "// My Code\n\nreturn true;" 238 | } 239 | ], 240 | "id": "runCode_v2" 241 | }, 242 | { 243 | "deprecated": true, 244 | "title": { 245 | "en": "Run code", 246 | "nl": "Voer code uit", 247 | "da": "Kør kode", 248 | "de": "Code ausführen", 249 | "es": "Ejecutar código", 250 | "fr": "Exécuter le code", 251 | "it": "Esegui codice", 252 | "no": "Kjør kode", 253 | "sv": "Kör kod", 254 | "pl": "Uruchom kod", 255 | "ru": "Запустить код", 256 | "ko": "코드 실행" 257 | }, 258 | "titleFormatted": { 259 | "en": "Run [[code]] with [[argument]]", 260 | "nl": "Voer [[code]] uit met [[argument]]", 261 | "da": "Kør [[code]] med [[argument]]", 262 | "de": "Führe [[code]] mit [[argument]] aus", 263 | "es": "Ejecuta [[code]] con [[argument]]", 264 | "fr": "Exécutez [[code]] avec [[argument]]", 265 | "it": "Esegui [[code]] con [[argument]]", 266 | "no": "Kjør [[code]] med [[argument]]", 267 | "sv": "Kör [[code]] med [[argument]]", 268 | "pl": "Uruchom [[code]] z [[argument]]", 269 | "ru": "Запустить [[code]] с [[argument]]", 270 | "ko": "[[argument]]과 함께 [[code]] 실행" 271 | }, 272 | "advanced": true, 273 | "args": [ 274 | { 275 | "name": "code", 276 | "type": "code", 277 | "language": "homeyscript", 278 | "title": { 279 | "en": "Code", 280 | "nl": "Code", 281 | "da": "Kode", 282 | "de": "Code", 283 | "es": "Código", 284 | "fr": "Code", 285 | "it": "Codice", 286 | "no": "Kode", 287 | "sv": "Kod", 288 | "pl": "Kod", 289 | "ru": "Код", 290 | "ko": "코드" 291 | }, 292 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 293 | }, 294 | { 295 | "name": "argument", 296 | "type": "text", 297 | "required": false, 298 | "title": { 299 | "en": "Argument", 300 | "nl": "Argument", 301 | "da": "Argument", 302 | "de": "Argument", 303 | "es": "Argumento", 304 | "fr": "Argument", 305 | "it": "Argomento", 306 | "no": "Argument", 307 | "sv": "Argument", 308 | "pl": "Argument", 309 | "ru": "Аргумент", 310 | "ko": "인수" 311 | }, 312 | "placeholder": { 313 | "en": "Argument", 314 | "nl": "Argument", 315 | "da": "Argument", 316 | "de": "Argument", 317 | "es": "Argumento", 318 | "fr": "Argument", 319 | "it": "Argomento", 320 | "no": "Argument", 321 | "sv": "Argument", 322 | "pl": "Argument", 323 | "ru": "Аргумент", 324 | "ko": "인수" 325 | }, 326 | "value": "MyArg" 327 | } 328 | ], 329 | "id": "runCodeWithArg" 330 | }, 331 | { 332 | "title": { 333 | "en": "Run code", 334 | "nl": "Voer code uit", 335 | "da": "Kør kode", 336 | "de": "Code ausführen", 337 | "es": "Ejecutar código", 338 | "fr": "Exécuter le code", 339 | "it": "Esegui codice", 340 | "no": "Kjør kode", 341 | "sv": "Kör kod", 342 | "pl": "Uruchom kod", 343 | "ru": "Запустить код", 344 | "ko": "코드 실행" 345 | }, 346 | "titleFormatted": { 347 | "en": "Run [[code]] with [[argument]]", 348 | "nl": "Voer [[code]] uit met [[argument]]", 349 | "da": "Kør [[code]] med [[argument]]", 350 | "de": "Führe [[code]] mit [[argument]] aus", 351 | "es": "Ejecutar [[code]] con [[argument]]", 352 | "fr": "Exécuter [[code]] avec [[argument]]", 353 | "it": "Esegui [[code]] con [[argument]]", 354 | "no": "Kjør [[code]] med [[argument]]", 355 | "sv": "Kör [[code]] med [[argument]]", 356 | "pl": "Uruchom [[code]] z [[argument]]", 357 | "ru": "Запустить [[code]] с [[argument]]", 358 | "ko": "[[code]] 실행 [[argument]]" 359 | }, 360 | "advanced": true, 361 | "args": [ 362 | { 363 | "name": "code", 364 | "type": "code", 365 | "language": "homeyscript", 366 | "title": { 367 | "en": "Code", 368 | "nl": "Code", 369 | "da": "Kode", 370 | "de": "Code", 371 | "es": "Código", 372 | "fr": "Code", 373 | "it": "Codice", 374 | "no": "Kode", 375 | "sv": "Kod", 376 | "pl": "Kod", 377 | "ru": "Код", 378 | "ko": "코드" 379 | }, 380 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 381 | }, 382 | { 383 | "name": "argument", 384 | "type": "text", 385 | "required": false, 386 | "title": { 387 | "en": "Argument", 388 | "nl": "Argument", 389 | "da": "Argument", 390 | "de": "Argument", 391 | "es": "Argumento", 392 | "fr": "Argument", 393 | "it": "Argomento", 394 | "no": "Argument", 395 | "sv": "Argument", 396 | "pl": "Argument", 397 | "ru": "Аргумент", 398 | "ko": "인수" 399 | }, 400 | "placeholder": { 401 | "en": "Argument", 402 | "nl": "Argument", 403 | "da": "Argument", 404 | "de": "Argument", 405 | "es": "Argumento", 406 | "fr": "Argument", 407 | "it": "Argomento", 408 | "no": "Argument", 409 | "sv": "Argument", 410 | "pl": "Argument", 411 | "ru": "Аргумент", 412 | "ko": "인수" 413 | }, 414 | "value": "MyArg" 415 | } 416 | ], 417 | "id": "runCodeWithArg_v2" 418 | }, 419 | { 420 | "title": { 421 | "en": "Run a script with an argument", 422 | "nl": "Voer een script uit met een argument", 423 | "da": "Kør et script med et argument", 424 | "de": "Führen Sie ein Skript mit einem Argument aus", 425 | "es": "Ejecutar un script con un argumento", 426 | "fr": "Exécuter un script avec un argument", 427 | "it": "Esegui uno script con un argomento", 428 | "no": "Kjør et skript med et argument", 429 | "sv": "Kör ett skript med ett argument", 430 | "pl": "Uruchom skrypt z argumentem", 431 | "ru": "Запустите сценарий с аргументом", 432 | "ko": "인수를 사용하여 스크립트를 실행합니다" 433 | }, 434 | "titleFormatted": { 435 | "en": "Run [[script]] with argument [[argument]]", 436 | "nl": "Voer [[script]] uit met argument [[argument]]", 437 | "da": "Kør [[script]] med argumentet [[argument]]", 438 | "de": "Führen Sie [[script]] mit Argument [[argument]] aus", 439 | "es": "Ejecutar [[script]] con el argumento [[argument]]", 440 | "fr": "Exécuter [[script]] avec l'argument [[argument]]", 441 | "it": "Esegui [[script]] con l'argomento [[argument]]", 442 | "no": "Kjør [[script]] med argumentet [[argument]]", 443 | "sv": "Kör [[script]] med argumentet [[argument]]", 444 | "pl": "Uruchom [[script]] z argumentem [[argument]]", 445 | "ru": "Запустите [[script]] с аргументом [[argument]]", 446 | "ko": "[[script]] 스크립트를 인수 [[argument]]와 함께 실행합니다" 447 | }, 448 | "args": [ 449 | { 450 | "name": "script", 451 | "type": "autocomplete", 452 | "title": { 453 | "en": "Script", 454 | "nl": "Script", 455 | "da": "Script", 456 | "de": "Script", 457 | "es": "Script", 458 | "fr": "Script", 459 | "it": "Script", 460 | "no": "Script", 461 | "sv": "Script", 462 | "pl": "Script", 463 | "ru": "Script", 464 | "ko": "Script" 465 | } 466 | }, 467 | { 468 | "name": "argument", 469 | "type": "text", 470 | "title": { 471 | "en": "Argument", 472 | "nl": "Argument", 473 | "da": "Argument", 474 | "de": "Argument", 475 | "es": "Argumento", 476 | "fr": "Argument", 477 | "it": "Argomento", 478 | "no": "Argument", 479 | "sv": "Argument", 480 | "pl": "Argument", 481 | "ru": "Аргумент", 482 | "ko": "인수" 483 | }, 484 | "placeholder": { 485 | "en": "Argument", 486 | "nl": "Argument", 487 | "da": "Argument", 488 | "de": "Argument", 489 | "es": "Argumento", 490 | "fr": "Argument", 491 | "it": "Argomento", 492 | "no": "Argument", 493 | "sv": "Argument", 494 | "pl": "Argument", 495 | "ru": "Аргумент", 496 | "ko": "인수" 497 | } 498 | } 499 | ], 500 | "id": "runWithArg" 501 | } 502 | ], 503 | "actions": [ 504 | { 505 | "title": { 506 | "en": "Run a script", 507 | "nl": "Voer een script uit", 508 | "da": "Kør et script", 509 | "de": "Ein Skript ausführen", 510 | "es": "Ejecutar un script", 511 | "fr": "Exécuter un script", 512 | "it": "Esegui uno script", 513 | "no": "Kjør et skript", 514 | "sv": "Kör ett skript", 515 | "pl": "Uruchom skrypt", 516 | "ru": "Выполнить скрипт", 517 | "ko": "스크립트 실행" 518 | }, 519 | "titleFormatted": { 520 | "en": "Run [[script]]", 521 | "nl": "Voer [[script]] uit", 522 | "da": "Kør [[script]]", 523 | "de": "Führe [[script]] aus", 524 | "es": "Ejecutar [[script]]", 525 | "fr": "Exécutez [[script]]", 526 | "it": "Esegui [[script]]", 527 | "no": "Kjør [[script]]", 528 | "sv": "Kör [[script]]", 529 | "pl": "Uruchom [[script]]", 530 | "ru": "Выполнить [[script]]", 531 | "ko": "[[script]] 실행" 532 | }, 533 | "args": [ 534 | { 535 | "name": "script", 536 | "type": "autocomplete", 537 | "title": { 538 | "en": "Script", 539 | "nl": "Script", 540 | "da": "Script", 541 | "de": "Skript", 542 | "es": "Script", 543 | "fr": "Script", 544 | "it": "Script", 545 | "no": "Script", 546 | "sv": "Script", 547 | "pl": "Skrypt", 548 | "ru": "Скрипт", 549 | "ko": "스크립트" 550 | } 551 | } 552 | ], 553 | "id": "run" 554 | }, 555 | { 556 | "deprecated": true, 557 | "title": { 558 | "en": "Run code", 559 | "nl": "Voer code uit", 560 | "da": "Kør kode", 561 | "de": "Code ausführen", 562 | "es": "Ejecutar código", 563 | "fr": "Exécuter le code", 564 | "it": "Esegui codice", 565 | "no": "Kjør kode", 566 | "sv": "Kör kod", 567 | "pl": "Uruchom kod", 568 | "ru": "Запустить код", 569 | "ko": "코드 실행" 570 | }, 571 | "titleFormatted": { 572 | "en": "Run [[code]]", 573 | "nl": "Voer [[code]] uit", 574 | "da": "Kør [[code]]", 575 | "de": "Führen Sie [[code]] aus", 576 | "es": "Ejecutar [[code]]", 577 | "fr": "Exécuter [[code]]", 578 | "it": "Esegui [[code]]", 579 | "no": "Kjør [[code]]", 580 | "sv": "Kör [[code]]", 581 | "pl": "Uruchom [[code]]", 582 | "ru": "Запустить [[code]]", 583 | "ko": "[[code]] 실행" 584 | }, 585 | "advanced": true, 586 | "args": [ 587 | { 588 | "name": "code", 589 | "type": "code", 590 | "language": "homeyscript", 591 | "title": { 592 | "en": "Code", 593 | "nl": "Code" 594 | }, 595 | "value": "// My Code" 596 | } 597 | ], 598 | "id": "runCode" 599 | }, 600 | { 601 | "title": { 602 | "en": "Run code", 603 | "nl": "Voer code uit", 604 | "da": "Kør kode", 605 | "de": "Code ausführen", 606 | "es": "Ejecutar código", 607 | "fr": "Exécuter le code", 608 | "it": "Esegui codice", 609 | "no": "Kjør kode", 610 | "sv": "Kör kod", 611 | "pl": "Uruchom kod", 612 | "ru": "Выполнить код", 613 | "ko": "코드 실행" 614 | }, 615 | "titleFormatted": { 616 | "en": "Run [[code]]", 617 | "nl": "Voer [[code]] uit", 618 | "da": "Kør [[code]]", 619 | "de": "Führe [[code]] aus", 620 | "es": "Ejecuta [[code]]", 621 | "fr": "Exécute [[code]]", 622 | "it": "Esegui [[code]]", 623 | "no": "Kjør [[code]]", 624 | "sv": "Kör [[code]]", 625 | "pl": "Uruchom [[code]]", 626 | "ru": "Выполнить [[code]]", 627 | "ko": "[[code]] 실행" 628 | }, 629 | "advanced": true, 630 | "args": [ 631 | { 632 | "name": "code", 633 | "type": "code", 634 | "language": "homeyscript", 635 | "title": { 636 | "en": "Code", 637 | "nl": "Code", 638 | "da": "Kode", 639 | "de": "Code", 640 | "es": "Código", 641 | "fr": "Code", 642 | "it": "Codice", 643 | "no": "Kode", 644 | "sv": "Kod", 645 | "pl": "Kod", 646 | "ru": "Код", 647 | "ko": "코드" 648 | }, 649 | "value": "// My Code" 650 | } 651 | ], 652 | "id": "runCode_v2" 653 | }, 654 | { 655 | "deprecated": true, 656 | "title": { 657 | "en": "Run code", 658 | "nl": "Voer code uit", 659 | "da": "Kør kode", 660 | "de": "Code ausführen", 661 | "es": "Ejecutar código", 662 | "fr": "Exécuter le code", 663 | "it": "Esegui il codice", 664 | "no": "Kjør kode", 665 | "sv": "Kör kod", 666 | "pl": "Uruchom kod", 667 | "ru": "Запустить код", 668 | "ko": "코드 실행" 669 | }, 670 | "titleFormatted": { 671 | "en": "Run [[code]] and return Yes/No-tag", 672 | "nl": "Voer [[code]] uit en return Ja/Nee-tag", 673 | "da": "Kør [[code]] og returner Ja/Nej-tag", 674 | "de": "Führen Sie [[code]] aus und geben Sie Ja/Nein-Tag zurück", 675 | "es": "Ejecutar [[code]] y devolver etiqueta Sí/No", 676 | "fr": "Exécuter [[code]] et retourner le tag Oui/Non", 677 | "it": "Esegui [[code]] e restituisci il tag Sì/No", 678 | "no": "Kjør [[code]] og returner Ja/Nei-tag", 679 | "sv": "Kör [[code]] och returnera Ja/Nej-tag", 680 | "pl": "Uruchom [[code]] i zwróć tag Tak/Nie", 681 | "ru": "Выполните [[code]] и верните тег Да/Нет", 682 | "ko": "[[code]] 실행하고 예/아니오 태그 반환" 683 | }, 684 | "tokens": [ 685 | { 686 | "name": "boolean", 687 | "type": "boolean", 688 | "title": { 689 | "en": "Result", 690 | "nl": "Resultaat", 691 | "da": "Resultat", 692 | "de": "Ergebnis", 693 | "es": "Resultado", 694 | "fr": "Résultat", 695 | "it": "Risultato", 696 | "no": "Resultat", 697 | "sv": "Resultat", 698 | "pl": "Wynik", 699 | "ru": "Результат", 700 | "ko": "결과" 701 | } 702 | } 703 | ], 704 | "args": [ 705 | { 706 | "name": "code", 707 | "type": "code", 708 | "language": "homeyscript", 709 | "title": { 710 | "en": "Code", 711 | "nl": "Code", 712 | "da": "Kode", 713 | "de": "Code", 714 | "es": "Código", 715 | "fr": "Code", 716 | "it": "Codice", 717 | "no": "Kode", 718 | "sv": "Kod", 719 | "pl": "Kod", 720 | "ru": "Код", 721 | "ko": "코드" 722 | }, 723 | "value": "// My Code\n\nreturn true;" 724 | } 725 | ], 726 | "id": "runCodeReturnsBoolean" 727 | }, 728 | { 729 | "title": { 730 | "en": "Run code", 731 | "nl": "Voer code uit", 732 | "da": "Kør kode", 733 | "de": "Code ausführen", 734 | "es": "Ejecutar código", 735 | "fr": "Exécuter le code", 736 | "it": "Esegui il codice", 737 | "no": "Kjør kode", 738 | "sv": "Kör kod", 739 | "pl": "Uruchom kod", 740 | "ru": "Запустить код", 741 | "ko": "코드 실행" 742 | }, 743 | "titleFormatted": { 744 | "en": "Run [[code]] and return Yes/No-tag", 745 | "nl": "Voer [[code]] uit en return Ja/Nee-tag", 746 | "da": "Kør [[code]] og returner Ja/Nej-tag", 747 | "de": "Führe [[code]] aus und gib Ja/Nein-Tag zurück", 748 | "es": "Ejecutar [[code]] y devolver etiqueta Sí/No", 749 | "fr": "Exécuter [[code]] et renvoyer l'étiquette Oui/Non", 750 | "it": "Esegui [[code]] e restituisci tag Sì/No", 751 | "no": "Kjør [[code]] og returner Ja/Nei-merke", 752 | "sv": "Kör [[code]] och returnera Ja/Nej-tag", 753 | "pl": "Uruchom [[code]] i zwróć tag Tak/Nie", 754 | "ru": "Запустить [[code]] и вернуть метку Да/Нет", 755 | "ko": "[[code]]를 실행하고 예/아니오 태그 반환" 756 | }, 757 | "tokens": [ 758 | { 759 | "name": "boolean", 760 | "type": "boolean", 761 | "title": { 762 | "en": "Result", 763 | "nl": "Resultaat", 764 | "da": "Resultat", 765 | "de": "Ergebnis", 766 | "es": "Resultado", 767 | "fr": "Résultat", 768 | "it": "Risultato", 769 | "no": "Resultat", 770 | "sv": "Resultat", 771 | "pl": "Wynik", 772 | "ru": "Результат", 773 | "ko": "결과" 774 | } 775 | } 776 | ], 777 | "args": [ 778 | { 779 | "name": "code", 780 | "type": "code", 781 | "language": "homeyscript", 782 | "title": { 783 | "en": "Code", 784 | "nl": "Code", 785 | "da": "Kode", 786 | "de": "Code", 787 | "es": "Código", 788 | "fr": "Code", 789 | "it": "Codice", 790 | "no": "Kode", 791 | "sv": "Kod", 792 | "pl": "Kod", 793 | "ru": "Код", 794 | "ko": "코드" 795 | }, 796 | "value": "// My Code\n\nreturn true;" 797 | } 798 | ], 799 | "id": "runCodeReturnsBoolean_v2" 800 | }, 801 | { 802 | "deprecated": true, 803 | "title": { 804 | "en": "Run code", 805 | "nl": "Voer code uit", 806 | "da": "Kør kode", 807 | "de": "Code ausführen", 808 | "es": "Ejecutar código", 809 | "fr": "Exécuter du code", 810 | "it": "Esegui codice", 811 | "no": "Kjør kode", 812 | "sv": "Kör kod", 813 | "pl": "Uruchom kod", 814 | "ru": "Запустить код", 815 | "ko": "코드 실행" 816 | }, 817 | "titleFormatted": { 818 | "en": "Run [[code]] and return Number-tag", 819 | "nl": "Voer [[code]] uit en return Nummer-tag", 820 | "da": "Kør [[code]] og returner nummer-tag", 821 | "de": "Führen Sie [[code]] aus und geben Sie Nummer-Tag zurück", 822 | "es": "Ejecuta [[code]] y devuelve la etiqueta de número", 823 | "fr": "Exécutez [[code]] et retournez l'étiquette de nombre", 824 | "it": "Esegui [[code]] e restituisci il tag numero", 825 | "no": "Kjør [[code]] og returner nummer-merke", 826 | "sv": "Kör [[code]] och returnera nummer-taggen", 827 | "pl": "Uruchom [[code]] i zwróć tag liczbowy", 828 | "ru": "Запустить [[code]] и вернуть тег числа", 829 | "ko": "[[code]] 실행하고 숫자 태그 반환" 830 | }, 831 | "tokens": [ 832 | { 833 | "name": "number", 834 | "type": "number", 835 | "title": { 836 | "en": "Result", 837 | "nl": "Resultaat", 838 | "da": "Resultat", 839 | "de": "Ergebnis", 840 | "es": "Resultado", 841 | "fr": "Résultat", 842 | "it": "Risultato", 843 | "no": "Resultat", 844 | "sv": "Resultat", 845 | "pl": "Wynik", 846 | "ru": "Результат", 847 | "ko": "결과" 848 | } 849 | } 850 | ], 851 | "args": [ 852 | { 853 | "name": "code", 854 | "type": "code", 855 | "language": "homeyscript", 856 | "title": { 857 | "en": "Code", 858 | "nl": "Code", 859 | "da": "Kode", 860 | "de": "Code", 861 | "es": "Código", 862 | "fr": "Code", 863 | "it": "Codice", 864 | "no": "Kode", 865 | "sv": "Kod", 866 | "pl": "Kod", 867 | "ru": "Код", 868 | "ko": "코드" 869 | }, 870 | "value": "// My Code\n\nreturn 1;" 871 | } 872 | ], 873 | "id": "runCodeReturnsNumber" 874 | }, 875 | { 876 | "title": { 877 | "en": "Run code", 878 | "nl": "Voer code uit", 879 | "da": "Kør kode", 880 | "de": "Code ausführen", 881 | "es": "Ejecutar código", 882 | "fr": "Exécuter le code", 883 | "it": "Esegui codice", 884 | "no": "Kjør kode", 885 | "sv": "Kör kod", 886 | "pl": "Uruchom kod", 887 | "ru": "Выполнить код", 888 | "ko": "코드 실행" 889 | }, 890 | "titleFormatted": { 891 | "en": "Run [[code]] and return Number-tag", 892 | "nl": "Voer [[code]] uit en return Nummer-tag", 893 | "da": "Kør [[code]] og returner nummer-tag", 894 | "de": "Führe [[code]] aus und gib Nummer-Tag zurück", 895 | "es": "Ejecuta [[code]] y devuelve la etiqueta de número", 896 | "fr": "Exécuter [[code]] et retourner l'étiquette de numéro", 897 | "it": "Esegui [[code]] e restituisci il tag numero", 898 | "no": "Kjør [[code]] og returner tallkode", 899 | "sv": "Kör [[code]] och returnera siffertagg", 900 | "pl": "Uruchom [[code]] i zwróć tag liczbowy", 901 | "ru": "Выполнить [[code]] и вернуть тег номера", 902 | "ko": "[[code]] 실행 후 숫자 태그 반환" 903 | }, 904 | "tokens": [ 905 | { 906 | "name": "number", 907 | "type": "number", 908 | "title": { 909 | "en": "Result", 910 | "nl": "Resultaat", 911 | "da": "Resultat", 912 | "de": "Ergebnis", 913 | "es": "Resultado", 914 | "fr": "Résultat", 915 | "it": "Risultato", 916 | "no": "Resultat", 917 | "sv": "Resultat", 918 | "pl": "Wynik", 919 | "ru": "Результат", 920 | "ko": "결과" 921 | } 922 | } 923 | ], 924 | "args": [ 925 | { 926 | "name": "code", 927 | "type": "code", 928 | "language": "homeyscript", 929 | "title": { 930 | "en": "Code", 931 | "nl": "Code", 932 | "da": "Kode", 933 | "de": "Code", 934 | "es": "Código", 935 | "fr": "Code", 936 | "it": "Codice", 937 | "no": "Kode", 938 | "sv": "Kod", 939 | "pl": "Kod", 940 | "ru": "Код", 941 | "ko": "코드" 942 | }, 943 | "value": "// My Code\n\nreturn 1;" 944 | } 945 | ], 946 | "id": "runCodeReturnsNumber_v2" 947 | }, 948 | { 949 | "deprecated": true, 950 | "title": { 951 | "en": "Run code", 952 | "nl": "Voer code uit", 953 | "da": "Kør kode", 954 | "de": "Code ausführen", 955 | "es": "Ejecutar código", 956 | "fr": "Exécuter le code", 957 | "it": "Esegui il codice", 958 | "no": "Kjør kode", 959 | "sv": "Kör kod", 960 | "pl": "Uruchom kod", 961 | "ru": "Запустить код", 962 | "ko": "코드 실행" 963 | }, 964 | "titleFormatted": { 965 | "en": "Run [[code]] and return Text-tag", 966 | "nl": "Voer [[code]] uit en return Tekst-tag", 967 | "da": "Kør [[code]] og returner tekst-tag", 968 | "de": "Führe [[code]] aus und gib Text-Tag zurück", 969 | "es": "Ejecuta [[code]] y devuelve etiqueta de texto", 970 | "fr": "Exécutez [[code]] et renvoyez l'étiquette de texte", 971 | "it": "Esegui [[code]] e restituisci l'etichetta di testo", 972 | "no": "Kjør [[code]] og returner tekst-etikett", 973 | "sv": "Kör [[code]] och returnera text-tagg", 974 | "pl": "Uruchom [[code]] i zwróć tag tekstowy", 975 | "ru": "Запустите [[code]] и верните текстовый тег", 976 | "ko": "[[code]]을 실행하고 텍스트 태그 반환" 977 | }, 978 | "tokens": [ 979 | { 980 | "name": "string", 981 | "type": "string", 982 | "title": { 983 | "en": "Result", 984 | "nl": "Resultaat", 985 | "da": "Resultat", 986 | "de": "Ergebnis", 987 | "es": "Resultado", 988 | "fr": "Résultat", 989 | "it": "Risultato", 990 | "no": "Resultat", 991 | "sv": "Resultat", 992 | "pl": "Wynik", 993 | "ru": "Результат", 994 | "ko": "결과" 995 | } 996 | } 997 | ], 998 | "args": [ 999 | { 1000 | "name": "code", 1001 | "type": "code", 1002 | "language": "homeyscript", 1003 | "title": { 1004 | "en": "Code", 1005 | "nl": "Code", 1006 | "da": "Kode", 1007 | "de": "Code", 1008 | "es": "Código", 1009 | "fr": "Code", 1010 | "it": "Codice", 1011 | "no": "Kode", 1012 | "sv": "Kod", 1013 | "pl": "Kod", 1014 | "ru": "Код", 1015 | "ko": "코드" 1016 | }, 1017 | "value": "// My Code\n\nreturn 'Hello World!';" 1018 | } 1019 | ], 1020 | "id": "runCodeReturnsString" 1021 | }, 1022 | { 1023 | "title": { 1024 | "en": "Run code", 1025 | "nl": "Voer code uit", 1026 | "da": "Kør kode", 1027 | "de": "Code ausführen", 1028 | "es": "Ejecutar código", 1029 | "fr": "Exécuter le code", 1030 | "it": "Esegui codice", 1031 | "no": "Kjør kode", 1032 | "sv": "Kör kod", 1033 | "pl": "Uruchom kod", 1034 | "ru": "Запустить код", 1035 | "ko": "코드 실행" 1036 | }, 1037 | "titleFormatted": { 1038 | "en": "Run [[code]] and return Text-tag", 1039 | "nl": "Voer [[code]] uit en return Tekst-tag", 1040 | "da": "Kør [[code]] og returner tekst-tag", 1041 | "de": "Führe [[code]] aus und gib Text-Tag zurück", 1042 | "es": "Ejecuta [[code]] y devuelve etiqueta de texto", 1043 | "fr": "Exécutez [[code]] et retournez une balise de texte", 1044 | "it": "Esegui [[code]] e restituisci un tag di testo", 1045 | "no": "Kjør [[code]] og returner tekst-tagg", 1046 | "sv": "Kör [[code]] och returnera text-tagg", 1047 | "pl": "Uruchom [[code]] i zwróć znacznik tekstu", 1048 | "ru": "Запустите [[code]] и верните текстовый тег", 1049 | "ko": "[[code]]를 실행하고 텍스트 태그 반환" 1050 | }, 1051 | "tokens": [ 1052 | { 1053 | "name": "string", 1054 | "type": "string", 1055 | "title": { 1056 | "en": "Result", 1057 | "nl": "Resultaat", 1058 | "da": "Resultat", 1059 | "de": "Ergebnis", 1060 | "es": "Resultado", 1061 | "fr": "Résultat", 1062 | "it": "Risultato", 1063 | "no": "Resultat", 1064 | "sv": "Resultat", 1065 | "pl": "Wynik", 1066 | "ru": "Результат", 1067 | "ko": "결과" 1068 | } 1069 | } 1070 | ], 1071 | "args": [ 1072 | { 1073 | "name": "code", 1074 | "type": "code", 1075 | "language": "homeyscript", 1076 | "title": { 1077 | "en": "Code", 1078 | "nl": "Code", 1079 | "da": "Kode", 1080 | "de": "Code", 1081 | "es": "Código", 1082 | "fr": "Code", 1083 | "it": "Codice", 1084 | "no": "Kode", 1085 | "sv": "Kod", 1086 | "pl": "Kod", 1087 | "ru": "Код", 1088 | "ko": "코드" 1089 | }, 1090 | "value": "// My Code\n\nreturn 'Hello World!';" 1091 | } 1092 | ], 1093 | "id": "runCodeReturnsString_v2" 1094 | }, 1095 | { 1096 | "deprecated": true, 1097 | "title": { 1098 | "en": "Run code", 1099 | "nl": "Voer code uit", 1100 | "da": "Kør kode", 1101 | "de": "Code ausführen", 1102 | "es": "Ejecutar código", 1103 | "fr": "Exécuter le code", 1104 | "it": "Esegui codice", 1105 | "no": "Kjør kode", 1106 | "sv": "Kör kod", 1107 | "pl": "Uruchom kod", 1108 | "ru": "Запустить код", 1109 | "ko": "코드 실행" 1110 | }, 1111 | "titleFormatted": { 1112 | "en": "Run [[code]] with [[argument]]", 1113 | "nl": "Voer [[code]] uit met [[argument]]", 1114 | "da": "Kør [[code]] med [[argument]]", 1115 | "de": "Führen Sie [[code]] mit [[argument]] aus", 1116 | "es": "Ejecutar [[code]] con [[argument]]", 1117 | "fr": "Exécuter [[code]] avec [[argument]]", 1118 | "it": "Esegui [[code]] con [[argument]]", 1119 | "no": "Kjør [[code]] med [[argument]]", 1120 | "sv": "Kör [[code]] med [[argument]]", 1121 | "pl": "Uruchom [[code]] z [[argument]]", 1122 | "ru": "Запустить [[code]] с [[argument]]", 1123 | "ko": "[[argument]]으로 [[code]] 실행" 1124 | }, 1125 | "advanced": true, 1126 | "args": [ 1127 | { 1128 | "name": "code", 1129 | "type": "code", 1130 | "language": "homeyscript", 1131 | "title": { 1132 | "en": "Code", 1133 | "nl": "Code", 1134 | "da": "Kode", 1135 | "de": "Code", 1136 | "es": "Código", 1137 | "fr": "Code", 1138 | "it": "Codice", 1139 | "no": "Kode", 1140 | "sv": "Kod", 1141 | "pl": "Kod", 1142 | "ru": "Код", 1143 | "ko": "코드" 1144 | }, 1145 | "value": "// My Code\n\nconsole.log(args[0]);" 1146 | }, 1147 | { 1148 | "name": "argument", 1149 | "type": "text", 1150 | "required": false, 1151 | "title": { 1152 | "en": "Argument", 1153 | "nl": "Argument", 1154 | "da": "Argument", 1155 | "de": "Argument", 1156 | "es": "Argumento", 1157 | "fr": "Argument", 1158 | "it": "Argomento", 1159 | "no": "Argument", 1160 | "sv": "Argument", 1161 | "pl": "Argument", 1162 | "ru": "Аргумент", 1163 | "ko": "인수" 1164 | }, 1165 | "placeholder": { 1166 | "en": "Argument", 1167 | "nl": "Argument", 1168 | "da": "Argument", 1169 | "de": "Argument", 1170 | "es": "Argumento", 1171 | "fr": "Argument", 1172 | "it": "Argomento", 1173 | "no": "Argument", 1174 | "sv": "Argument", 1175 | "pl": "Argument", 1176 | "ru": "Аргумент", 1177 | "ko": "인수" 1178 | }, 1179 | "value": "MyArg" 1180 | } 1181 | ], 1182 | "id": "runCodeWithArg" 1183 | }, 1184 | { 1185 | "title": { 1186 | "en": "Run code", 1187 | "nl": "Voer code uit", 1188 | "da": "Kør kode", 1189 | "de": "Code ausführen", 1190 | "es": "Ejecutar código", 1191 | "fr": "Exécuter le code", 1192 | "it": "Esegui codice", 1193 | "no": "Kjør kode", 1194 | "sv": "Kör kod", 1195 | "pl": "Uruchom kod", 1196 | "ru": "Запуск кода", 1197 | "ko": "코드 실행" 1198 | }, 1199 | "titleFormatted": { 1200 | "en": "Run [[code]] with [[argument]]", 1201 | "nl": "Voer [[code]] uit met [[argument]]", 1202 | "da": "Kør [[code]] med [[argument]]", 1203 | "de": "Führe [[code]] mit [[argument]] aus", 1204 | "es": "Ejecutar [[code]] con [[argument]]", 1205 | "fr": "Exécuter [[code]] avec [[argument]]", 1206 | "it": "Esegui [[code]] con [[argument]]", 1207 | "no": "Kjør [[code]] med [[argument]]", 1208 | "sv": "Kör [[code]] med [[argument]]", 1209 | "pl": "Uruchom [[code]] z [[argument]]", 1210 | "ru": "Запустить [[code]] с [[argument]]", 1211 | "ko": "[[code]] 실행[[argument]]" 1212 | }, 1213 | "advanced": true, 1214 | "args": [ 1215 | { 1216 | "name": "code", 1217 | "type": "code", 1218 | "language": "homeyscript", 1219 | "title": { 1220 | "en": "Code", 1221 | "nl": "Code", 1222 | "da": "Kode", 1223 | "de": "Code", 1224 | "es": "Código", 1225 | "fr": "Code", 1226 | "it": "Codice", 1227 | "no": "Kode", 1228 | "sv": "Kod", 1229 | "pl": "Kod", 1230 | "ru": "Код", 1231 | "ko": "코드" 1232 | }, 1233 | "value": "// My Code\n\nconsole.log(args[0]);" 1234 | }, 1235 | { 1236 | "name": "argument", 1237 | "type": "text", 1238 | "required": false, 1239 | "title": { 1240 | "en": "Argument", 1241 | "nl": "Argument", 1242 | "da": "Argument", 1243 | "de": "Argument", 1244 | "es": "Argumento", 1245 | "fr": "Argument", 1246 | "it": "Argomento", 1247 | "no": "Argument", 1248 | "sv": "Argument", 1249 | "pl": "Argument", 1250 | "ru": "Аргумент", 1251 | "ko": "인수" 1252 | }, 1253 | "placeholder": { 1254 | "en": "Argument", 1255 | "nl": "Argument", 1256 | "da": "Argument", 1257 | "de": "Argument", 1258 | "es": "Argumento", 1259 | "fr": "Argument", 1260 | "it": "Argomento", 1261 | "no": "Argument", 1262 | "sv": "Argument", 1263 | "pl": "Argument", 1264 | "ru": "Аргумент", 1265 | "ko": "인수" 1266 | }, 1267 | "value": "MyArg" 1268 | } 1269 | ], 1270 | "id": "runCodeWithArg_v2" 1271 | }, 1272 | { 1273 | "deprecated": true, 1274 | "title": { 1275 | "en": "Run code", 1276 | "nl": "Voer code uit", 1277 | "da": "Kør kode", 1278 | "de": "Code ausführen", 1279 | "es": "Ejecutar código", 1280 | "fr": "Exécuter le code", 1281 | "it": "Esegui codice", 1282 | "no": "Kjør kode", 1283 | "sv": "Kör kod", 1284 | "pl": "Uruchom kod", 1285 | "ru": "Запустить код", 1286 | "ko": "코드 실행" 1287 | }, 1288 | "titleFormatted": { 1289 | "en": "Run [[code]] with [[argument]] and return Yes/No-tag", 1290 | "nl": "Voer [[code]] uit met [[argument]] en return Ja/Nee-tag", 1291 | "da": "Kør [[code]] med [[argument]] og returner Ja/Nej-tag", 1292 | "de": "Führe [[code]] mit [[argument]] aus und gib Ja/Nein-Tag zurück", 1293 | "es": "Ejecutar [[code]] con [[argument]] y devolver etiqueta Sí/No", 1294 | "fr": "Exécuter [[code]] avec [[argument]] et retourner une étiquette Oui/Non", 1295 | "it": "Esegui [[code]] con [[argument]] e restituisci tag Sì/No", 1296 | "no": "Kjør [[code]] med [[argument]] og returner Ja/Nei-tag", 1297 | "sv": "Kör [[code]] med [[argument]] och returnera Ja/Nej-tag", 1298 | "pl": "Uruchom [[code]] z [[argument]] i zwróć tag Tak/Nie", 1299 | "ru": "Запустите [[code]] с [[argument]] и верните тег Да/Нет", 1300 | "ko": "[[argument]]와 함께 [[code]]를 실행하고 예/아니요 태그 반환" 1301 | }, 1302 | "tokens": [ 1303 | { 1304 | "name": "boolean", 1305 | "type": "boolean", 1306 | "title": { 1307 | "en": "Result", 1308 | "nl": "Resultaat", 1309 | "da": "Resultat", 1310 | "de": "Ergebnis", 1311 | "es": "Resultado", 1312 | "fr": "Résultat", 1313 | "it": "Risultato", 1314 | "no": "Resultat", 1315 | "sv": "Resultat", 1316 | "pl": "Wynik", 1317 | "ru": "Результат", 1318 | "ko": "결과" 1319 | } 1320 | } 1321 | ], 1322 | "args": [ 1323 | { 1324 | "name": "code", 1325 | "type": "code", 1326 | "language": "homeyscript", 1327 | "title": { 1328 | "en": "Code", 1329 | "nl": "Code", 1330 | "da": "Kode", 1331 | "de": "Code", 1332 | "es": "Código", 1333 | "fr": "Code", 1334 | "it": "Codice", 1335 | "no": "Kode", 1336 | "sv": "Kod", 1337 | "pl": "Kod", 1338 | "ru": "Код", 1339 | "ko": "코드" 1340 | }, 1341 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 1342 | }, 1343 | { 1344 | "name": "argument", 1345 | "type": "text", 1346 | "required": false, 1347 | "title": { 1348 | "en": "Argument", 1349 | "nl": "Argument", 1350 | "da": "Argument", 1351 | "de": "Argument", 1352 | "es": "Argumento", 1353 | "fr": "Argument", 1354 | "it": "Argomento", 1355 | "no": "Argument", 1356 | "sv": "Argument", 1357 | "pl": "Argument", 1358 | "ru": "Аргумент", 1359 | "ko": "인수" 1360 | }, 1361 | "placeholder": { 1362 | "en": "Argument", 1363 | "nl": "Argument", 1364 | "da": "Argument", 1365 | "de": "Argument", 1366 | "es": "Argumento", 1367 | "fr": "Argument", 1368 | "it": "Argomento", 1369 | "no": "Argument", 1370 | "sv": "Argument", 1371 | "pl": "Argument", 1372 | "ru": "Аргумент", 1373 | "ko": "인수" 1374 | }, 1375 | "value": "MyArg" 1376 | } 1377 | ], 1378 | "id": "runCodeWithArgReturnsBoolean" 1379 | }, 1380 | { 1381 | "title": { 1382 | "en": "Run code", 1383 | "nl": "Voer code uit", 1384 | "da": "Kør kode", 1385 | "de": "Code ausführen", 1386 | "es": "Ejecutar código", 1387 | "fr": "Exécuter le code", 1388 | "it": "Esegui codice", 1389 | "no": "Kjør kode", 1390 | "sv": "Kör kod", 1391 | "pl": "Uruchom kod", 1392 | "ru": "Выполнить код", 1393 | "ko": "코드 실행" 1394 | }, 1395 | "titleFormatted": { 1396 | "en": "Run [[code]] with [[argument]] and return Yes/No-tag", 1397 | "nl": "Voer [[code]] uit met [[argument]] en return Ja/Nee-tag", 1398 | "da": "Kør [[code]] med [[argument]] og returner Ja/Nej-tag", 1399 | "de": "Führe [[code]] mit [[argument]] aus und gib ein Ja/Nein-Tag zurück", 1400 | "es": "Ejecuta [[code]] con [[argument]] y devuelve una etiqueta Sí/No", 1401 | "fr": "Exécute [[code]] avec [[argument]] et retourne une étiquette Oui/Non", 1402 | "it": "Esegui [[code]] con [[argument]] e restituisci una tag Sì/No", 1403 | "no": "Kjør [[code]] med [[argument]] og returner Ja/Nei-merke", 1404 | "sv": "Kör [[code]] med [[argument]] och returnera ett Ja/Nej-tag", 1405 | "pl": "Uruchom [[code]] z [[argument]] i zwróć tag Tak/Nie", 1406 | "ru": "Выполните [[code]] с [[argument]] и верните тег Да/Нет", 1407 | "ko": "[[code]]를 [[argument]]으로 실행하고 예/아니오 태그 반환" 1408 | }, 1409 | "tokens": [ 1410 | { 1411 | "name": "boolean", 1412 | "type": "boolean", 1413 | "title": { 1414 | "en": "Result", 1415 | "nl": "Resultaat", 1416 | "da": "Resultat", 1417 | "de": "Ergebnis", 1418 | "es": "Resultado", 1419 | "fr": "Résultat", 1420 | "it": "Risultato", 1421 | "no": "Resultat", 1422 | "sv": "Resultat", 1423 | "pl": "Wynik", 1424 | "ru": "Результат", 1425 | "ko": "결과" 1426 | } 1427 | } 1428 | ], 1429 | "args": [ 1430 | { 1431 | "name": "code", 1432 | "type": "code", 1433 | "language": "homeyscript", 1434 | "title": { 1435 | "en": "Code", 1436 | "nl": "Code", 1437 | "da": "Kode", 1438 | "de": "Code", 1439 | "es": "Código", 1440 | "fr": "Code", 1441 | "it": "Codice", 1442 | "no": "Kode", 1443 | "sv": "Kod", 1444 | "pl": "Kod", 1445 | "ru": "Код", 1446 | "ko": "코드" 1447 | }, 1448 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;" 1449 | }, 1450 | { 1451 | "name": "argument", 1452 | "type": "text", 1453 | "required": false, 1454 | "title": { 1455 | "en": "Argument", 1456 | "nl": "Argument", 1457 | "da": "Argument", 1458 | "de": "Argument", 1459 | "es": "Argumento", 1460 | "fr": "Argument", 1461 | "it": "Argomento", 1462 | "no": "Argument", 1463 | "sv": "Argument", 1464 | "pl": "Argument", 1465 | "ru": "Аргумент", 1466 | "ko": "인수" 1467 | }, 1468 | "placeholder": { 1469 | "en": "Argument", 1470 | "nl": "Argument", 1471 | "da": "Argument", 1472 | "de": "Argument", 1473 | "es": "Argumento", 1474 | "fr": "Argument", 1475 | "it": "Argomento", 1476 | "no": "Argument", 1477 | "sv": "Argument", 1478 | "pl": "Argument", 1479 | "ru": "Аргумент", 1480 | "ko": "인수" 1481 | }, 1482 | "value": "MyArg" 1483 | } 1484 | ], 1485 | "id": "runCodeWithArgReturnsBoolean_v2" 1486 | }, 1487 | { 1488 | "deprecated": true, 1489 | "title": { 1490 | "en": "Run code", 1491 | "nl": "Voer code uit", 1492 | "da": "Kør kode", 1493 | "de": "Code ausführen", 1494 | "es": "Ejecutar código", 1495 | "fr": "Exécuter le code", 1496 | "it": "Esegui codice", 1497 | "no": "Kjør kode", 1498 | "sv": "Kör kod", 1499 | "pl": "Uruchom kod", 1500 | "ru": "Запустить код", 1501 | "ko": "코드 실행" 1502 | }, 1503 | "titleFormatted": { 1504 | "en": "Run [[code]] with [[argument]] and return Number-tag", 1505 | "nl": "Voer [[code]] uit met [[argument]] en return Nummer-tag", 1506 | "da": "Kør [[code]] med [[argument]] og returner Number-tag", 1507 | "de": "Führe [[code]] mit [[argument]] aus und gib Number-tag zurück", 1508 | "es": "Ejecutar [[code]] con [[argument]] y devolver etiqueta de número", 1509 | "fr": "Exécuter [[code]] avec [[argument]] et renvoyer une étiquette numérique", 1510 | "it": "Esegui [[code]] con [[argument]] e restituisci il tag numero", 1511 | "no": "Kjør [[code]] med [[argument]] og returner Nummer-tag", 1512 | "sv": "Kör [[code]] med [[argument]] och returnera Num-mer-tag", 1513 | "pl": "Uruchom [[code]] z [[argument]] i zwróć tag liczby", 1514 | "ru": "Выполнить [[code]] с [[argument]] и вернуть Number-tag", 1515 | "ko": "[[code]]를 [[argument]]와 함께 실행하고 Number-tag 반환" 1516 | }, 1517 | "tokens": [ 1518 | { 1519 | "name": "number", 1520 | "type": "number", 1521 | "title": { 1522 | "en": "Result", 1523 | "nl": "Resultaat", 1524 | "da": "Resultat", 1525 | "de": "Ergebnis", 1526 | "es": "Resultado", 1527 | "fr": "Résultat", 1528 | "it": "Risultato", 1529 | "no": "Resultat", 1530 | "sv": "Resultat", 1531 | "pl": "Wynik", 1532 | "ru": "Результат", 1533 | "ko": "결과" 1534 | } 1535 | } 1536 | ], 1537 | "args": [ 1538 | { 1539 | "name": "code", 1540 | "type": "code", 1541 | "language": "homeyscript", 1542 | "title": { 1543 | "en": "Code", 1544 | "nl": "Code", 1545 | "da": "Kode", 1546 | "de": "Code", 1547 | "es": "Código", 1548 | "fr": "Code", 1549 | "it": "Codice", 1550 | "no": "Kode", 1551 | "sv": "Kod", 1552 | "pl": "Kod", 1553 | "ru": "Код", 1554 | "ko": "코드" 1555 | }, 1556 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 1;" 1557 | }, 1558 | { 1559 | "name": "argument", 1560 | "type": "text", 1561 | "required": false, 1562 | "title": { 1563 | "en": "Argument", 1564 | "nl": "Argument", 1565 | "da": "Argument", 1566 | "de": "Argument", 1567 | "es": "Argumento", 1568 | "fr": "Argument", 1569 | "it": "Argomento", 1570 | "no": "Argument", 1571 | "sv": "Argument", 1572 | "pl": "Argument", 1573 | "ru": "Аргумент", 1574 | "ko": "인수" 1575 | }, 1576 | "placeholder": { 1577 | "en": "Argument", 1578 | "nl": "Argument", 1579 | "da": "Argument", 1580 | "de": "Argument", 1581 | "es": "Argumento", 1582 | "fr": "Argument", 1583 | "it": "Argomento", 1584 | "no": "Argument", 1585 | "sv": "Argument", 1586 | "pl": "Argument", 1587 | "ru": "Аргумент", 1588 | "ko": "인수" 1589 | }, 1590 | "value": "MyArg" 1591 | } 1592 | ], 1593 | "id": "runCodeWithArgReturnsNumber" 1594 | }, 1595 | { 1596 | "title": { 1597 | "en": "Run code", 1598 | "nl": "Voer code uit", 1599 | "da": "Kør kode", 1600 | "de": "Code ausführen", 1601 | "es": "Ejecutar código", 1602 | "fr": "Exécuter le code", 1603 | "it": "Esegui codice", 1604 | "no": "Kjør kode", 1605 | "sv": "Kör kod", 1606 | "pl": "Uruchom kod", 1607 | "ru": "Запустить код", 1608 | "ko": "코드 실행" 1609 | }, 1610 | "titleFormatted": { 1611 | "en": "Run [[code]] with [[argument]] and return Number-tag", 1612 | "nl": "Voer [[code]] uit met [[argument]] en return Nummer-tag", 1613 | "da": "Kør [[code]] med [[argument]] og returner Nummer-tag", 1614 | "de": "Führen Sie [[code]] mit [[argument]] aus und geben Sie die Nummer-Taste zurück", 1615 | "es": "Ejecutar [[code]] con [[argument]] y devolver la etiqueta de número", 1616 | "fr": "Exécuter [[code]] avec [[argument]] et retourner l'étiquette Nombre", 1617 | "it": "Esegui [[code]] con [[argument]] e restituisci il tag Numero", 1618 | "no": "Kjør [[code]] med [[argument]] og returner Nummer-tag", 1619 | "sv": "Kör [[code]] med [[argument]] och returnera Nummer-tagg", 1620 | "pl": "Uruchom [[code]] z [[argument]] i zwróć Tag Numer", 1621 | "ru": "Запуск [[code]] с [[argument]] и возврат тега Число", 1622 | "ko": "[[argument]]와 함께 [[code]] 실행하고 숫자 태그 반환" 1623 | }, 1624 | "tokens": [ 1625 | { 1626 | "name": "number", 1627 | "type": "number", 1628 | "title": { 1629 | "en": "Result", 1630 | "nl": "Resultaat", 1631 | "da": "Resultat", 1632 | "de": "Ergebnis", 1633 | "es": "Resultado", 1634 | "fr": "Résultat", 1635 | "it": "Risultato", 1636 | "no": "Resultat", 1637 | "sv": "Resultat", 1638 | "pl": "Wynik", 1639 | "ru": "Результат", 1640 | "ko": "결과" 1641 | } 1642 | } 1643 | ], 1644 | "args": [ 1645 | { 1646 | "name": "code", 1647 | "type": "code", 1648 | "language": "homeyscript", 1649 | "title": { 1650 | "en": "Code", 1651 | "nl": "Code", 1652 | "da": "Kode", 1653 | "de": "Code", 1654 | "es": "Código", 1655 | "fr": "Code", 1656 | "it": "Codice", 1657 | "no": "Kode", 1658 | "sv": "Kod", 1659 | "pl": "Kod", 1660 | "ru": "Код", 1661 | "ko": "코드" 1662 | }, 1663 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 1;" 1664 | }, 1665 | { 1666 | "name": "argument", 1667 | "type": "text", 1668 | "required": false, 1669 | "title": { 1670 | "en": "Argument", 1671 | "nl": "Argument", 1672 | "da": "Argument", 1673 | "de": "Argument", 1674 | "es": "Argumento", 1675 | "fr": "Argument", 1676 | "it": "Argomento", 1677 | "no": "Argument", 1678 | "sv": "Argument", 1679 | "pl": "Argument", 1680 | "ru": "Аргумент", 1681 | "ko": "인수" 1682 | }, 1683 | "placeholder": { 1684 | "en": "Argument", 1685 | "nl": "Argument", 1686 | "da": "Argument", 1687 | "de": "Argument", 1688 | "es": "Argumento", 1689 | "fr": "Argument", 1690 | "it": "Argomento", 1691 | "no": "Argument", 1692 | "sv": "Argument", 1693 | "pl": "Argument", 1694 | "ru": "Аргумент", 1695 | "ko": "인수" 1696 | }, 1697 | "value": "MyArg" 1698 | } 1699 | ], 1700 | "id": "runCodeWithArgReturnsNumber_v2" 1701 | }, 1702 | { 1703 | "deprecated": true, 1704 | "title": { 1705 | "en": "Run code", 1706 | "nl": "Voer code uit", 1707 | "da": "Kør kode", 1708 | "de": "Code ausführen", 1709 | "es": "Ejecutar código", 1710 | "fr": "Exécuter le code", 1711 | "it": "Esegui codice", 1712 | "no": "Kjør kode", 1713 | "sv": "Kör kod", 1714 | "pl": "Uruchom kod", 1715 | "ru": "Запустить код", 1716 | "ko": "코드 실행" 1717 | }, 1718 | "titleFormatted": { 1719 | "en": "Run [[code]] with [[argument]] and return Text-tag", 1720 | "nl": "Voer [[code]] uit met [[argument]] en return Tekst-tag", 1721 | "da": "Kør [[code]] med [[argument]] og returner tekst-tag", 1722 | "de": "Führen Sie [[code]] mit [[argument]] aus und geben Sie Text-Tag zurück", 1723 | "es": "Ejecuta [[code]] con [[argument]] y devuelve la etiqueta de texto", 1724 | "fr": "Exécutez [[code]] avec [[argument]] et renvoyez une balise texte", 1725 | "it": "Esegui [[code]] con [[argument]] e restituisci il tag di testo", 1726 | "no": "Kjør [[code]] med [[argument]] og returner tekst-etikett", 1727 | "sv": "Kör [[code]] med [[argument]] och returnera texttagg", 1728 | "pl": "Uruchom [[code]] z [[argument]] i zwróć znacznik tekstowy", 1729 | "ru": "Запустите [[code]] с [[argument]] и верните текстовый тег", 1730 | "ko": "[[code]]를 [[argument]]로 실행하고 텍스트 태그 반환" 1731 | }, 1732 | "tokens": [ 1733 | { 1734 | "name": "string", 1735 | "type": "string", 1736 | "title": { 1737 | "en": "Result", 1738 | "nl": "Resultaat", 1739 | "da": "Resultat", 1740 | "de": "Ergebnis", 1741 | "es": "Resultado", 1742 | "fr": "Résultat", 1743 | "it": "Risultato", 1744 | "no": "Resultat", 1745 | "sv": "Resultat", 1746 | "pl": "Wynik", 1747 | "ru": "Результат", 1748 | "ko": "결과" 1749 | } 1750 | } 1751 | ], 1752 | "args": [ 1753 | { 1754 | "name": "code", 1755 | "type": "code", 1756 | "language": "homeyscript", 1757 | "title": { 1758 | "en": "Code", 1759 | "nl": "Code", 1760 | "da": "Kode", 1761 | "de": "Code", 1762 | "es": "Código", 1763 | "fr": "Code", 1764 | "it": "Codice", 1765 | "no": "Kode", 1766 | "sv": "Kod", 1767 | "pl": "Kod", 1768 | "ru": "Код", 1769 | "ko": "코드" 1770 | }, 1771 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 'Hello World!';" 1772 | }, 1773 | { 1774 | "name": "argument", 1775 | "type": "text", 1776 | "required": false, 1777 | "title": { 1778 | "en": "Argument", 1779 | "nl": "Argument", 1780 | "da": "Argument", 1781 | "de": "Argument", 1782 | "es": "Argumento", 1783 | "fr": "Argument", 1784 | "it": "Argomento", 1785 | "no": "Argument", 1786 | "sv": "Argument", 1787 | "pl": "Argument", 1788 | "ru": "Аргумент", 1789 | "ko": "인수" 1790 | }, 1791 | "placeholder": { 1792 | "en": "Argument", 1793 | "nl": "Argument", 1794 | "da": "Argument", 1795 | "de": "Argument", 1796 | "es": "Argumento", 1797 | "fr": "Argument", 1798 | "it": "Argomento", 1799 | "no": "Argument", 1800 | "sv": "Argument", 1801 | "pl": "Argument", 1802 | "ru": "Аргумент", 1803 | "ko": "인수" 1804 | }, 1805 | "value": "MyArg" 1806 | } 1807 | ], 1808 | "id": "runCodeWithArgReturnsString" 1809 | }, 1810 | { 1811 | "title": { 1812 | "en": "Run code", 1813 | "nl": "Voer code uit", 1814 | "da": "Kør kode", 1815 | "de": "Code ausführen", 1816 | "es": "Ejecutar código", 1817 | "fr": "Exécuter le code", 1818 | "it": "Esegui codice", 1819 | "no": "Kjør kode", 1820 | "sv": "Kör kod", 1821 | "pl": "Uruchom kod", 1822 | "ru": "Выполнить код", 1823 | "ko": "코드 실행" 1824 | }, 1825 | "titleFormatted": { 1826 | "en": "Run [[code]] with [[argument]] and return Text-tag", 1827 | "nl": "Voer [[code]] uit met [[argument]] en return Tekst-tag", 1828 | "da": "Kør [[code]] med [[argument]] og returner Tekst-tag", 1829 | "de": "Führe [[code]] mit [[argument]] aus und gib Text-Tag zurück", 1830 | "es": "Ejecutar [[code]] con [[argument]] y devolver etiqueta de texto", 1831 | "fr": "Exécutez [[code]] avec [[argument]] et retournez l'étiquette texte", 1832 | "it": "Esegui [[code]] con [[argument]] e restituisci etichetta di testo", 1833 | "no": "Kjør [[code]] med [[argument]] og returner tekst-tag", 1834 | "sv": "Kör [[code]] med [[argument]] och returnera text-tagg", 1835 | "pl": "Uruchom [[code]] z [[argument]] i zwróć etykietę tekstową", 1836 | "ru": "Выполнить [[code]] с [[argument]] и вернуть текстовый тег", 1837 | "ko": "[[code]]을 [[argument]] 로 실행하고 텍스트 태그 반환" 1838 | }, 1839 | "tokens": [ 1840 | { 1841 | "name": "string", 1842 | "type": "string", 1843 | "title": { 1844 | "en": "Result", 1845 | "nl": "Resultaat", 1846 | "da": "Resultat", 1847 | "de": "Ergebnis", 1848 | "es": "Resultado", 1849 | "fr": "Résultat", 1850 | "it": "Risultato", 1851 | "no": "Resultat", 1852 | "sv": "Resultat", 1853 | "pl": "Wynik", 1854 | "ru": "Результат", 1855 | "ko": "결과" 1856 | } 1857 | } 1858 | ], 1859 | "args": [ 1860 | { 1861 | "name": "code", 1862 | "type": "code", 1863 | "language": "homeyscript", 1864 | "title": { 1865 | "en": "Code", 1866 | "nl": "Code", 1867 | "da": "Kode", 1868 | "de": "Code", 1869 | "es": "Código", 1870 | "fr": "Code", 1871 | "it": "Codice", 1872 | "no": "Kode", 1873 | "sv": "Kod", 1874 | "pl": "Kod", 1875 | "ru": "Код", 1876 | "ko": "코드" 1877 | }, 1878 | "value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 'Hello World!';" 1879 | }, 1880 | { 1881 | "name": "argument", 1882 | "type": "text", 1883 | "required": false, 1884 | "title": { 1885 | "en": "Argument", 1886 | "nl": "Argument", 1887 | "da": "Argument", 1888 | "de": "Argument", 1889 | "es": "Argumento", 1890 | "fr": "Argument", 1891 | "it": "Argomento", 1892 | "no": "Argument", 1893 | "sv": "Argument", 1894 | "pl": "Argument", 1895 | "ru": "Аргумент", 1896 | "ko": "인수" 1897 | }, 1898 | "placeholder": { 1899 | "en": "Argument", 1900 | "nl": "Argument", 1901 | "da": "Argument", 1902 | "de": "Argument", 1903 | "es": "Argumento", 1904 | "fr": "Argument", 1905 | "it": "Argomento", 1906 | "no": "Argument", 1907 | "sv": "Argument", 1908 | "pl": "Argument", 1909 | "ru": "Аргумент", 1910 | "ko": "인수" 1911 | }, 1912 | "value": "MyArg" 1913 | } 1914 | ], 1915 | "id": "runCodeWithArgReturnsString_v2" 1916 | }, 1917 | { 1918 | "title": { 1919 | "en": "Run a script with an argument", 1920 | "nl": "Voer een script uit met een argument", 1921 | "da": "Kør et script med et argument", 1922 | "de": "Führe ein Script mit einem Argument aus", 1923 | "es": "Ejecutar un script con un argumento", 1924 | "fr": "Exécuter un script avec un argument", 1925 | "it": "Eseguire uno script con un argomento", 1926 | "no": "Kjør et skript med et argument", 1927 | "sv": "Kör ett skript med ett argument", 1928 | "pl": "Uruchom skrypt z argumentem", 1929 | "ru": "Запустить скрипт с аргументом", 1930 | "ko": "인수를 사용하여 스크립트 실행" 1931 | }, 1932 | "titleFormatted": { 1933 | "en": "Run [[script]] with argument [[argument]]", 1934 | "nl": "Voer [[script]] uit met argument [[argument]]", 1935 | "da": "Kør [[script]] med argument [[argument]]", 1936 | "de": "Führe [[script]] mit dem Argument [[argument]] aus", 1937 | "es": "Ejecutar [[script]] con argumento [[argument]]", 1938 | "fr": "Exécuter [[script]] avec l'argument [[argument]]", 1939 | "it": "Esegui [[script]] con l'argomento [[argument]]", 1940 | "no": "Kjør [[script]] med argumentet [[argument]]", 1941 | "sv": "Kör [[script]] med argumentet [[argument]]", 1942 | "pl": "Uruchom [[script]] z argumentem [[argument]]", 1943 | "ru": "Запуск [[script]] с аргументом [[argument]]", 1944 | "ko": "[[script]]를 [[argument]] 인수로 실행" 1945 | }, 1946 | "args": [ 1947 | { 1948 | "name": "script", 1949 | "type": "autocomplete", 1950 | "title": { 1951 | "en": "Script", 1952 | "nl": "Script", 1953 | "da": "Script", 1954 | "de": "Script", 1955 | "es": "Script", 1956 | "fr": "Script", 1957 | "it": "Script", 1958 | "no": "Skript", 1959 | "sv": "Skript", 1960 | "pl": "Skrypt", 1961 | "ru": "Скрипт", 1962 | "ko": "스크립트" 1963 | } 1964 | }, 1965 | { 1966 | "name": "argument", 1967 | "type": "text", 1968 | "title": { 1969 | "en": "Argument", 1970 | "nl": "Argument", 1971 | "da": "Argument", 1972 | "de": "Argument", 1973 | "es": "Argumento", 1974 | "fr": "Argument", 1975 | "it": "Argomento", 1976 | "no": "Argument", 1977 | "sv": "Argument", 1978 | "pl": "Argument", 1979 | "ru": "Аргумент", 1980 | "ko": "인수" 1981 | }, 1982 | "placeholder": { 1983 | "en": "Argument", 1984 | "nl": "Argument", 1985 | "da": "Argument", 1986 | "de": "Argument", 1987 | "es": "Argumento", 1988 | "fr": "Argument", 1989 | "it": "Argomento", 1990 | "no": "Argument", 1991 | "sv": "Argument", 1992 | "pl": "Argument", 1993 | "ru": "Аргумент", 1994 | "ko": "인수" 1995 | } 1996 | } 1997 | ], 1998 | "id": "runWithArg" 1999 | } 2000 | ] 2001 | } 2002 | } --------------------------------------------------------------------------------