Skip to content

Commit

Permalink
Major code refactoring
Browse files Browse the repository at this point in the history
* introduced new item configuration syntax using device metadata concept
* added new device capabilities for camera, door/window covering, fan, networking and vacuum
* improved security arm state error handling
* added input custom mappings support
* added playback stop and thermostat hold/fan capabilities support
* added new custom asset ids and semantic extensions
* added switch support to mode generic capability
* improved dimmer/rollershutter support for range value generic capability
* updated test suite increasing code coverage
* added support for ask-cli v2 using cloudformation deployer
* improved ci integration with automated production release deployment
* added github action to update repository locales on crowdin changes
* deprecated item sensor concept for decouple state support on specific capabilities
* removed item tag support for oh3.x
* removed alexa smarthome api v2 support

Signed-off-by: jsetton <jeremy.setton@gmail.com>
  • Loading branch information
jsetton committed Nov 9, 2021
1 parent 7472c94 commit 157dc9e
Show file tree
Hide file tree
Showing 473 changed files with 51,216 additions and 19,321 deletions.
9 changes: 0 additions & 9 deletions .ask/config

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/build.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches: [ main ]
paths: [ lambda/** ]
pull_request:
branches: [ main ]
paths: [ lambda/** ]

jobs:
test:
name: Code Testing
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: lambda/package-lock.json

- name: Install dependencies
run: npm ci
working-directory: lambda

- name: Run tests
run: npm run test:coverage
working-directory: lambda

- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: lambda/coverage

codeql:
name: Code Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deployment

on:
release:
types: [ published ]
workflow_dispatch:
inputs:
pr:
description: Pull Request (development)
required: false
tag:
description: Release Version (live)
required: false

env:
DEPLOY_ENV: ${{ (github.event_name == 'release' || github.event.inputs.tag) && 'live' || 'development' }}

jobs:
skill:
name: Skill Deployment
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.pr && format('refs/pull/{0}/merge', github.event.inputs.pr) || github.event.inputs.tag }}

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: npm
cache-dependency-path: lambda/package-lock.json

- name: Install ASK CLI
run: npm install -g jsetton/ask-cli

- name: Cache ASK CLI states
uses: actions/cache@v2
with:
path: .ask/ask-states.json
key: ask-states-${{ env.DEPLOY_ENV }}

- name: Generate deployment config
run: node tools/generateDeployConfig.js
env:
FUNCTION_NAME: ${{ env.DEPLOY_ENV == 'live' && 'openhab-alexa' || 'openhab-alexa-beta' }}
LOG_LEVEL: ${{ env.DEPLOY_ENV == 'live' && 'error' || 'info' }}
S3_BUCKET_NA: ${{ secrets.S3_BUCKET_NA }}
S3_BUCKET_EU: ${{ secrets.S3_BUCKET_EU }}
S3_BUCKET_FE: ${{ secrets.S3_BUCKET_FE }}
SKILL_ID: ${{ secrets.SKILL_ID }}
TESTING_USERNAME: ${{ secrets.TESTING_USERNAME }}
TESTING_PASSWORD: ${{ secrets.TESTING_PASSWORD }}

- name: Deploy skill and AWS resources
run: ask deploy
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ASK_ACCESS_TOKEN: ${{ secrets.ASK_ACCESS_TOKEN }}
ASK_REFRESH_TOKEN : ${{ secrets.ASK_REFRESH_TOKEN }}
ASK_VENDOR_ID: ${{ secrets.ASK_VENDOR_ID }}
ASK_SHARE_USAGE: false
23 changes: 23 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Documentation

on:
push:
branches: [ main ]
paths: [ '**.md' ]
pull_request:
branches: [ main ]
paths: [ '**.md' ]

jobs:
markdown:
name: Markdown Linting
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Lint Markdown files
uses: nosborn/github-action-markdown-cli@v2
with:
files: '**.md'
36 changes: 36 additions & 0 deletions .github/workflows/locale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Locale

on:
push:
branches: [ main ]
paths: [ resources/locales/** ]

jobs:
update:
name: Locale Updates
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x

- name: Update skill locale
run: node tools/updateSkillLocale.js

- name: Check for changes to commit
id: changes
run: test -n "$(git status -suno)"
continue-on-error: true

- name: Commit and push changes
if: steps.changes.outcome == 'success'
run: |
git config user.name openhab-bot
git config user.email bot@openhab.org
git commit -a -m "New locale updates"
git push
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/lambda/*/catalog.json
/lambda/*/config.js
ssl/
.ask
lambda/ssl/
skill-package/accountLinking.json

# VS Code
.vscode

# Logs
Expand Down
9 changes: 9 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default: true

# Line length
MD013: false
# Multiple top-level headings in the same document
MD025: false
# Inline HTML
MD033:
allowed_elements: [a, br, img]
26 changes: 14 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Contribution guidelines
# Contributing

## Guidelines

### Pull requests are always welcome

Expand All @@ -10,27 +12,25 @@ If your pull request is not accepted on the first try, don't be
discouraged! If there's a problem with the implementation, hopefully you
received feedback on what to improve.

### Discuss your design on the mailing list
### Discuss your design in the discussion forum

We recommend discussing your plans [in the discussion forum](https://community.openhab.org/)
before starting to code - especially for more ambitious contributions.
This gives other contributors a chance to point you in the right
direction, give feedback on your design, and maybe point out if someone
else is working on the same thing.

### Create issues...

Any significant improvement should be documented as [a GitHub
issue](https://github.com/openhab/openhab-alxea/issues?labels=enhancement&page=1&state=open) before anybody
starts working on it.

### ...but check for existing issues first!
### Create issues

Please take a moment to check that an issue doesn't already exist
documenting your bug report or improvement proposal. If it does, it
never hurts to add a quick "+1" or "I have this problem too". This will
help prioritize the most common problems and requests.

Any significant improvement should be documented as [a GitHub
issue](https://github.com/openhab/openhab-alxea/issues?labels=enhancement&page=1&state=open) before anybody
starts working on it.

### Conventions

Fork the repo and make changes on your fork in a feature branch.
Expand Down Expand Up @@ -78,7 +78,7 @@ pass it on as an open-source patch. The rules are pretty simple: if you
can certify the below (from
[developercertificate.org](http://developercertificate.org/)):

```
```text
Developer Certificate of Origin
Version 1.1
Expand Down Expand Up @@ -119,7 +119,9 @@ By making a contribution to this project, I certify that:

then you just add a line to every git commit message:

Signed-off-by: Joe Smith <joe.smith@email.com> (github: github_handle)
```text
Signed-off-by: Joe Smith <joe.smith@email.com> (github: github_handle)
```

using your real name (sorry, no pseudonyms or anonymous contributions.)

Expand All @@ -130,7 +132,7 @@ There are several exceptions to the signing requirement. Currently these are:
* Your patch fixes spelling or grammar errors.
* Your patch is a single line change to documentation.

## Community Guidelines
## Code of Conduct

We want to keep the openHAB-alexa community awesome, growing and collaborative. We
need your help to keep it that way. To help with this we've come up with some
Expand Down
Loading

0 comments on commit 157dc9e

Please sign in to comment.