Skip to content

Commit

Permalink
Merge pull request #54 from athombv/feature/homey-api
Browse files Browse the repository at this point in the history
feature/homey-api
  • Loading branch information
jeroenwienk committed Apr 15, 2024
2 parents 0ad58cd + 5cd3bb3 commit 79ab4d5
Show file tree
Hide file tree
Showing 67 changed files with 3,771 additions and 3,556 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ indent_size = 2

trim_trailing_whitespace = true

max_line_length = 120
max_line_length = 100
insert_final_newline = true

ij_javascript_use_double_quotes = false
Expand Down
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier'],
env: {
node: true,
es2023: true,
},
overrides: [
{
files: ['*.js', '*.mjs'],
rules: {
'no-unused-vars': ['warn', { args: 'none' }],
},
},
],
ignorePatterns: ['/examples/**', '/examples-v1/**', 'build'],
};
6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

48 changes: 31 additions & 17 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,34 @@ jobs:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'

# Build
- name: Build
run: npm run build

# Deploy
- name: Deploy To GitHub Pages
uses: peaceiris/[email protected]
with:
personal_token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}
publish_dir: ./build
- uses: actions/checkout@v4

- uses: webfactory/[email protected]
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
if: env.SSH_KEY != null
with:
ssh-private-key: ${{ env.SSH_KEY }}

# Setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'

- name: Install modules
run: npm clean-install --audit=false
env:
GITHUB_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}

# Build
- name: Build
run: npm run build

# Deploy
- name: Deploy To GitHub Pages
uses: peaceiris/[email protected]
with:
personal_token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}
publish_dir: ./build
41 changes: 25 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Lint

# Optional secrets:
# - SSH_KEY: if `npm ci` needs to install private npm packages
# Version: 2.0.1
# Modified: Yes
#
# Secrets:
# - HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN
# - SSH_KEY

# GitHub repo configuration:
# 1. If you have protected branches, go to Branches > edit protected branch > enable 'Require status checks to pass before
Expand All @@ -12,33 +16,38 @@ name: Lint
# Defines the trigger for this action (e.g. [pull_request, push])
# For more information see: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#about-workflow-events)
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
pull_request:
- develop

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
# Checks out the current repository.
- uses: actions/checkout@v2

# Configures a Node.js environment.
- uses: actions/setup-node@v1
with:
node-version: '12'
- uses: actions/checkout@v4

# Set SSH key
- uses: webfactory/[email protected]
- uses: webfactory/[email protected]
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
if: env.SSH_KEY != null
with:
ssh-private-key: ${{ env.SSH_KEY }}

# Run `npm ci` to re-create your local environment (make sure to commit your package-lock.json!).
# Finally run `npm run lint` (make sure you have defined a lint command in package.json e.g. "lint": "eslint .").
- run: npm ci
- run: npm run lint
# Setup
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'

- name: Install modules
run: npm clean-install --audit=false
env:
GITHUB_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}

- name: Lint
run: npm run lint
1 change: 1 addition & 0 deletions .homeycompose/flow/actions/runCode.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
1 change: 1 addition & 0 deletions .homeycompose/flow/actions/runCodeReturnsBoolean.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
32 changes: 32 additions & 0 deletions .homeycompose/flow/actions/runCodeReturnsBoolean_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"title": {
"en": "Run code",
"nl": "Voer code uit"
},
"titleFormatted": {
"en": "Run [[code]] and return Yes/No-tag",
"nl": "Voer [[code]] uit en return Ja/Nee-tag"
},
"tokens": [
{
"name": "boolean",
"type": "boolean",
"title": {
"en": "Result",
"nl": "Resultaat"
}
}
],
"args": [
{
"name": "code",
"type": "code",
"language": "homeyscript",
"title": {
"en": "Code",
"nl": "Code"
},
"value": "// My Code\n\nreturn true;"
}
]
}
1 change: 1 addition & 0 deletions .homeycompose/flow/actions/runCodeReturnsNumber.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
32 changes: 32 additions & 0 deletions .homeycompose/flow/actions/runCodeReturnsNumber_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"title": {
"en": "Run code",
"nl": "Voer code uit"
},
"titleFormatted": {
"en": "Run [[code]] and return Number-tag",
"nl": "Voer [[code]] uit en return Nummer-tag"
},
"tokens": [
{
"name": "number",
"type": "number",
"title": {
"en": "Result",
"nl": "Resultaat"
}
}
],
"args": [
{
"name": "code",
"type": "code",
"language": "homeyscript",
"title": {
"en": "Code",
"nl": "Code"
},
"value": "// My Code\n\nreturn 1;"
}
]
}
1 change: 1 addition & 0 deletions .homeycompose/flow/actions/runCodeReturnsString.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
32 changes: 32 additions & 0 deletions .homeycompose/flow/actions/runCodeReturnsString_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"title": {
"en": "Run code",
"nl": "Voer code uit"
},
"titleFormatted": {
"en": "Run [[code]] and return Text-tag",
"nl": "Voer [[code]] uit en return Tekst-tag"
},
"tokens": [
{
"name": "string",
"type": "string",
"title": {
"en": "Result",
"nl": "Resultaat"
}
}
],
"args": [
{
"name": "code",
"type": "code",
"language": "homeyscript",
"title": {
"en": "Code",
"nl": "Code"
},
"value": "// My Code\n\nreturn 'Hello World!';"
}
]
}
1 change: 1 addition & 0 deletions .homeycompose/flow/actions/runCodeWithArg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
46 changes: 46 additions & 0 deletions .homeycompose/flow/actions/runCodeWithArgReturnsBoolean_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"title": {
"en": "Run code",
"nl": "Voer code uit"
},
"titleFormatted": {
"en": "Run [[code]] with [[argument]] and return Yes/No-tag",
"nl": "Voer [[code]] uit met [[argument]] en return Ja/Nee-tag"
},
"tokens": [
{
"name": "boolean",
"type": "boolean",
"title": {
"en": "Result",
"nl": "Resultaat"
}
}
],
"args": [
{
"name": "code",
"type": "code",
"language": "homeyscript",
"title": {
"en": "Code",
"nl": "Code"
},
"value": "// My Code\n\nconsole.log(args[0]);\n\nreturn true;"
},
{
"name": "argument",
"type": "text",
"required": false,
"title": {
"en": "Argument",
"nl": "Argument"
},
"placeholder": {
"en": "Argument",
"nl": "Argument"
},
"value": "MyArg"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deprecated": true,
"title": {
"en": "Run code",
"nl": "Voer code uit"
Expand Down
46 changes: 46 additions & 0 deletions .homeycompose/flow/actions/runCodeWithArgReturnsNumber_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"title": {
"en": "Run code",
"nl": "Voer code uit"
},
"titleFormatted": {
"en": "Run [[code]] with [[argument]] and return Number-tag",
"nl": "Voer [[code]] uit met [[argument]] en return Nummer-tag"
},
"tokens": [
{
"name": "number",
"type": "number",
"title": {
"en": "Result",
"nl": "Resultaat"
}
}
],
"args": [
{
"name": "code",
"type": "code",
"language": "homeyscript",
"title": {
"en": "Code",
"nl": "Code"
},
"value": "// My Code\n\nconsole.log(args[0]);\n\nreturn 1;"
},
{
"name": "argument",
"type": "text",
"required": false,
"title": {
"en": "Argument",
"nl": "Argument"
},
"placeholder": {
"en": "Argument",
"nl": "Argument"
},
"value": "MyArg"
}
]
}
Loading

0 comments on commit 79ab4d5

Please sign in to comment.