mirror of
https://github.com/hassio-addons/addon-zwave-js-ui.git
synced 2025-05-07 04:41:28 +00:00
Add initial add-on code (#1)
This commit is contained in:
parent
69b561fdcd
commit
c937fa42b0
41 changed files with 1706 additions and 0 deletions
19
.editorconfig
Executable file
19
.editorconfig
Executable file
|
@ -0,0 +1,19 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
ident_size = 4
|
||||
|
||||
[*.md]
|
||||
ident_size = 2
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.json]
|
||||
ident_size = 2
|
||||
|
||||
[{.gitignore,.gitkeep,.editorconfig}]
|
||||
ident_size = 2
|
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.github/* @frenck
|
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
github: frenck
|
||||
patreon: frenck
|
||||
custom: https://frenck.dev/donate/
|
20
.github/ISSUE_TEMPLATE.md
vendored
Executable file
20
.github/ISSUE_TEMPLATE.md
vendored
Executable file
|
@ -0,0 +1,20 @@
|
|||
# Problem/Motivation
|
||||
|
||||
> (Why the issue was filed)
|
||||
|
||||
## Expected behavior
|
||||
|
||||
> (What you expected to happen)
|
||||
|
||||
## Actual behavior
|
||||
|
||||
> (What actually happened)
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
> (How can someone else make/see it happen)
|
||||
|
||||
## Proposed changes
|
||||
|
||||
> (If you have a proposed change, workaround or fix,
|
||||
> describe the rationale behind it)
|
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
Executable file
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
Executable file
|
@ -0,0 +1,9 @@
|
|||
# Proposed Changes
|
||||
|
||||
> (Describe the changes and rationale behind them)
|
||||
|
||||
## Related Issues
|
||||
|
||||
> ([Github link][autolink-references] to related issues or pull requests)
|
||||
|
||||
[autolink-references]: https://help.github.com/articles/autolinked-references-and-urls/
|
8
.github/dependabot.yaml
vendored
Normal file
8
.github/dependabot.yaml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "06:00"
|
85
.github/labels.yml
vendored
Normal file
85
.github/labels.yml
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
---
|
||||
- name: "breaking-change"
|
||||
color: ee0701
|
||||
description: "A breaking change for existing users."
|
||||
- name: "bugfix"
|
||||
color: ee0701
|
||||
description: "Inconsistencies or issues which will cause a problem for users or implementors."
|
||||
- name: "documentation"
|
||||
color: 0052cc
|
||||
description: "Solely about the documentation of the project."
|
||||
- name: "enhancement"
|
||||
color: 1d76db
|
||||
description: "Enhancement of the code, not introducing new features."
|
||||
- name: "refactor"
|
||||
color: 1d76db
|
||||
description: "Improvement of existing code, not introducing new features."
|
||||
- name: "performance"
|
||||
color: 1d76db
|
||||
description: "Improving performance, not introducing new features."
|
||||
- name: "new-feature"
|
||||
color: 0e8a16
|
||||
description: "New features or options."
|
||||
- name: "maintenance"
|
||||
color: 2af79e
|
||||
description: "Generic maintenance tasks."
|
||||
- name: "ci"
|
||||
color: 1d76db
|
||||
description: "Work that improves the continue integration."
|
||||
- name: "dependencies"
|
||||
color: 1d76db
|
||||
description: "Upgrade or downgrade of project dependencies."
|
||||
|
||||
- name: "in-progress"
|
||||
color: fbca04
|
||||
description: "Issue is currently being resolved by a developer."
|
||||
- name: "stale"
|
||||
color: fef2c0
|
||||
description: "There has not been activity on this issue or PR for quite some time."
|
||||
- name: "no-stale"
|
||||
color: fef2c0
|
||||
description: "This issue or PR is exempted from the stable bot."
|
||||
|
||||
- name: "security"
|
||||
color: ee0701
|
||||
description: "Marks a security issue that needs to be resolved asap."
|
||||
- name: "incomplete"
|
||||
color: fef2c0
|
||||
description: "Marks a PR or issue that is missing information."
|
||||
- name: "invalid"
|
||||
color: fef2c0
|
||||
description: "Marks a PR or issue that is missing information."
|
||||
|
||||
- name: "beginner-friendly"
|
||||
color: 0e8a16
|
||||
description: "Good first issue for people wanting to contribute to the project."
|
||||
- name: "help-wanted"
|
||||
color: 0e8a16
|
||||
description: "We need some extra helping hands or expertise in order to resolve this."
|
||||
|
||||
- name: "hacktoberfest"
|
||||
description: "Issues/PRs are participating in the Hacktoberfest."
|
||||
color: fbca04
|
||||
- name: "hacktoberfest-accepted"
|
||||
description: "Issues/PRs are participating in the Hacktoberfest."
|
||||
color: fbca04
|
||||
|
||||
- name: "priority-critical"
|
||||
color: ee0701
|
||||
description: "This should be dealt with ASAP. Not fixing this issue would be a serious error."
|
||||
- name: "priority-high"
|
||||
color: b60205
|
||||
description: "After critical issues are fixed, these should be dealt with before any further issues."
|
||||
- name: "priority-medium"
|
||||
color: 0e8a16
|
||||
description: "This issue may be useful, and needs some attention."
|
||||
- name: "priority-low"
|
||||
color: e4ea8a
|
||||
description: "Nice addition, maybe... someday..."
|
||||
|
||||
- name: "major"
|
||||
color: b60205
|
||||
description: "This PR causes a major version bump in the version number."
|
||||
- name: "minor"
|
||||
color: 0e8a16
|
||||
description: "This PR causes a minor version bump in the version number."
|
57
.github/release-drafter.yml
vendored
Normal file
57
.github/release-drafter.yml
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
name-template: "v$RESOLVED_VERSION"
|
||||
tag-template: "v$RESOLVED_VERSION"
|
||||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
|
||||
sort-direction: ascending
|
||||
|
||||
categories:
|
||||
- title: "🚨 Breaking changes"
|
||||
labels:
|
||||
- "breaking-change"
|
||||
- title: "✨ New features"
|
||||
labels:
|
||||
- "new-feature"
|
||||
- title: "🐛 Bug fixes"
|
||||
labels:
|
||||
- "bugfix"
|
||||
- title: "🚀 Enhancements"
|
||||
labels:
|
||||
- "enhancement"
|
||||
- "refactor"
|
||||
- "performance"
|
||||
- title: "🧰 Maintenance"
|
||||
labels:
|
||||
- "maintenance"
|
||||
- "ci"
|
||||
- title: "📚 Documentation"
|
||||
labels:
|
||||
- "documentation"
|
||||
- title: "⬆️ Dependency updates"
|
||||
labels:
|
||||
- "dependencies"
|
||||
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- "major"
|
||||
- "breaking-change"
|
||||
minor:
|
||||
labels:
|
||||
- "minor"
|
||||
- "new-feature"
|
||||
patch:
|
||||
labels:
|
||||
- "bugfix"
|
||||
- "chore"
|
||||
- "ci"
|
||||
- "dependencies"
|
||||
- "documentation"
|
||||
- "enhancement"
|
||||
- "performance"
|
||||
- "refactor"
|
||||
default: patch
|
||||
|
||||
template: |
|
||||
## What’s changed
|
||||
|
||||
$CHANGES
|
182
.github/workflows/ci.yaml
vendored
Normal file
182
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,182 @@
|
|||
---
|
||||
name: CI
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
information:
|
||||
name: Gather add-on information
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
architectures: ${{ steps.information.outputs.architectures }}
|
||||
build: ${{ steps.information.outputs.build }}
|
||||
description: ${{ steps.information.outputs.description }}
|
||||
name: ${{ steps.information.outputs.name }}
|
||||
slug: ${{ steps.information.outputs.slug }}
|
||||
target: ${{ steps.information.outputs.target }}
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run add-on information action
|
||||
id: information
|
||||
uses: frenck/action-addon-information@v1.0.0
|
||||
|
||||
lint-addon:
|
||||
name: Lint Add-on
|
||||
needs:
|
||||
- information
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run Add-on Lint
|
||||
uses: frenck/action-addon-linter@v1.4
|
||||
with:
|
||||
community: true
|
||||
path: "./${{ needs.information.outputs.target }}"
|
||||
|
||||
lint-hadolint:
|
||||
name: Hadolint
|
||||
needs:
|
||||
- information
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run Hadolint
|
||||
uses: brpaz/hadolint-action@v1.3.1
|
||||
with:
|
||||
dockerfile: "./${{ needs.information.outputs.target }}/Dockerfile"
|
||||
|
||||
lint-json:
|
||||
name: JSON Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run JQ
|
||||
run: |
|
||||
shopt -s globstar
|
||||
cat **/*.json | jq '.'
|
||||
|
||||
lint-markdown:
|
||||
name: MarkdownLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run mdl
|
||||
uses: actionshub/markdownlint@2.0.0
|
||||
|
||||
lint-shellcheck:
|
||||
name: Shellcheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run Shellcheck
|
||||
uses: ludeeus/action-shellcheck@1.0.0
|
||||
env:
|
||||
SHELLCHECK_OPTS: -s bash
|
||||
|
||||
lint-yamllint:
|
||||
name: YAMLLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run YAMLLint
|
||||
uses: frenck/action-yamllint@v1.0.2
|
||||
|
||||
lint-prettier:
|
||||
name: Prettier
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run Prettier
|
||||
uses: creyD/prettier_action@v3.3
|
||||
with:
|
||||
prettier_options: --write **/*.{json,js,md,yaml}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
build:
|
||||
name: Build ${{ matrix.architecture }}
|
||||
needs:
|
||||
- information
|
||||
- lint-addon
|
||||
- lint-hadolint
|
||||
- lint-json
|
||||
- lint-markdown
|
||||
- lint-prettier
|
||||
- lint-shellcheck
|
||||
- lint-yamllint
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🏗 Set up build cache
|
||||
id: cache
|
||||
uses: actions/cache@v2.1.3
|
||||
with:
|
||||
path: /tmp/.docker-cache
|
||||
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
docker-${{ github.ref }}-${{ matrix.architecture }}
|
||||
- name: 🏗 Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1.0.1
|
||||
- name: 🏗 Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1.1.1
|
||||
- name: ℹ️ Compose build flags
|
||||
id: flags
|
||||
run: |
|
||||
echo "::set-output name=date::$(date +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
from=$(jq --raw-output ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
|
||||
echo "::set-output name=from::${from}"
|
||||
|
||||
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
|
||||
echo "::set-output name=platform::linux/amd64"
|
||||
elif [[ "${{ matrix.architecture }}" = "i386" ]]; then
|
||||
echo "::set-output name=platform::linux/386"
|
||||
elif [[ "${{ matrix.architecture }}" = "armhf" ]]; then
|
||||
echo "::set-output name=platform::linux/arm/v6"
|
||||
elif [[ "${{ matrix.architecture }}" = "armv7" ]]; then
|
||||
echo "::set-output name=platform::linux/arm/v7"
|
||||
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
|
||||
echo "::set-output name=platform::linux/arm64/v8"
|
||||
else
|
||||
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
|
||||
exit 1
|
||||
fi
|
||||
- name: 🚀 Build
|
||||
uses: docker/build-push-action@v2.2.2
|
||||
with:
|
||||
push: false
|
||||
context: ${{ needs.information.outputs.target }}
|
||||
file: ${{ needs.information.outputs.target }}/Dockerfile
|
||||
cache-from: |
|
||||
type=local,src=/tmp/.docker-cache
|
||||
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
|
||||
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
|
||||
platforms: ${{ steps.flags.outputs.platform }}
|
||||
build-args: |
|
||||
BUILD_ARCH=${{ matrix.architecture }}
|
||||
BUILD_DATE=${{ steps.flags.outputs.date }}
|
||||
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
|
||||
BUILD_FROM=${{ steps.flags.outputs.from }}
|
||||
BUILD_NAME=${{ needs.information.outputs.name }}
|
||||
BUILD_REF=${{ github.sha }}
|
||||
BUILD_REPOSITORY=${{ github.repository }}
|
||||
BUILD_VERSION=edge
|
206
.github/workflows/deploy.yaml
vendored
Normal file
206
.github/workflows/deploy.yaml
vendored
Normal file
|
@ -0,0 +1,206 @@
|
|||
---
|
||||
name: Deploy
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_run:
|
||||
workflows: ["CI"]
|
||||
branches: [main]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
information:
|
||||
if: |
|
||||
github.event_name == 'release'
|
||||
|| (
|
||||
github.event_name == 'workflow_run'
|
||||
&& github.event.workflow_run.conclusion == 'success'
|
||||
)
|
||||
name: ℹ️ Gather add-on information
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
architectures: ${{ steps.information.outputs.architectures }}
|
||||
build: ${{ steps.information.outputs.build }}
|
||||
description: ${{ steps.information.outputs.description }}
|
||||
environment: ${{ steps.release.outputs.environment }}
|
||||
name: ${{ steps.information.outputs.name }}
|
||||
slug: ${{ steps.information.outputs.slug }}
|
||||
target: ${{ steps.information.outputs.target }}
|
||||
version: ${{ steps.release.outputs.version }}
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run add-on information action
|
||||
id: information
|
||||
uses: frenck/action-addon-information@v1.0.0
|
||||
- name: ℹ️ Gather version and environment
|
||||
id: release
|
||||
run: |
|
||||
sha="${{ github.sha }}"
|
||||
environment="edge"
|
||||
version="${sha:0:7}"
|
||||
if [[ "${{ github.event_name }}" = "release" ]]; then
|
||||
version="${{ github.event.release.tag_name }}"
|
||||
version="${version,,}"
|
||||
version="${version#v}"
|
||||
environment="stable"
|
||||
if [[ "${{ github.event.release.prerelease }}" = "true" ]]; then
|
||||
environment="beta"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "::set-output name=environment::${environment}"
|
||||
echo "::set-output name=version::${version}"
|
||||
|
||||
deploy:
|
||||
name: 👷 Build & Deploy ${{ matrix.architecture }}
|
||||
needs: information
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🏗 Set up build cache
|
||||
id: cache
|
||||
uses: actions/cache@v2.1.3
|
||||
with:
|
||||
path: /tmp/.docker-cache
|
||||
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
docker-${{ github.ref }}-${{ matrix.architecture }}
|
||||
- name: 🏗 Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1.0.1
|
||||
- name: 🏗 Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1.1.1
|
||||
- name: ℹ️ Compose build flags
|
||||
id: flags
|
||||
run: |
|
||||
echo "::set-output name=date::$(date +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
from=$(jq --raw-output ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
|
||||
echo "::set-output name=from::${from}"
|
||||
|
||||
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
|
||||
echo "::set-output name=platform::linux/amd64"
|
||||
elif [[ "${{ matrix.architecture }}" = "i386" ]]; then
|
||||
echo "::set-output name=platform::linux/386"
|
||||
elif [[ "${{ matrix.architecture }}" = "armhf" ]]; then
|
||||
echo "::set-output name=platform::linux/arm/v6"
|
||||
elif [[ "${{ matrix.architecture }}" = "armv7" ]]; then
|
||||
echo "::set-output name=platform::linux/arm/v7"
|
||||
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
|
||||
echo "::set-output name=platform::linux/arm64/v8"
|
||||
else
|
||||
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
|
||||
exit 1
|
||||
fi
|
||||
- name: 🏗 Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
password: ${{ secrets.GHCR_PASSWORD }}
|
||||
- name: 🚀 Build and push
|
||||
uses: docker/build-push-action@v2.2.2
|
||||
with:
|
||||
push: true
|
||||
# yamllint disable rule:line-length
|
||||
tags: |
|
||||
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
|
||||
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
|
||||
# yamllint enable rule:line-length
|
||||
context: ${{ needs.information.outputs.target }}
|
||||
file: ${{ needs.information.outputs.target }}/Dockerfile
|
||||
cache-from: |
|
||||
type=local,src=/tmp/.docker-cache
|
||||
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
|
||||
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
|
||||
platforms: ${{ steps.flags.outputs.platform }}
|
||||
build-args: |
|
||||
BUILD_ARCH=${{ matrix.architecture }}
|
||||
BUILD_DATE=${{ steps.flags.outputs.date }}
|
||||
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
|
||||
BUILD_FROM=${{ steps.flags.outputs.from }}
|
||||
BUILD_NAME=${{ needs.information.outputs.name }}
|
||||
BUILD_REF=${{ github.sha }}
|
||||
BUILD_REPOSITORY=${{ github.repository }}
|
||||
BUILD_VERSION=${{ needs.information.outputs.version }}
|
||||
|
||||
publish-edge:
|
||||
name: 📢 Publish to edge repository
|
||||
if: needs.information.outputs.environment == 'edge'
|
||||
needs:
|
||||
- information
|
||||
- deploy
|
||||
environment:
|
||||
name: ${{ needs.information.outputs.environment }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Dispatch repository updater update signal
|
||||
uses: peter-evans/repository-dispatch@v1.1.3
|
||||
with:
|
||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||
repository: hassio-addons/repository-edge
|
||||
event-type: update
|
||||
client-payload: >
|
||||
{
|
||||
"addon": "${{ needs.information.outputs.slug }}",
|
||||
"name": "${{ needs.information.outputs.name }}",
|
||||
"repository": "${{ github.repository }}",
|
||||
"version": "${{ needs.information.outputs.version }}"
|
||||
}
|
||||
|
||||
publish-beta:
|
||||
name: 📢 Publish to beta repository
|
||||
if: |
|
||||
needs.information.outputs.environment == 'beta' ||
|
||||
needs.information.outputs.environment == 'stable'
|
||||
needs:
|
||||
- information
|
||||
- deploy
|
||||
environment:
|
||||
name: ${{ needs.information.outputs.environment }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Dispatch repository updater update signal
|
||||
uses: peter-evans/repository-dispatch@v1.1.3
|
||||
with:
|
||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||
repository: hassio-addons/repository-beta
|
||||
event-type: update
|
||||
client-payload: >
|
||||
{
|
||||
"addon": "${{ needs.information.outputs.slug }}",
|
||||
"name": "${{ needs.information.outputs.name }}",
|
||||
"repository": "${{ github.repository }}",
|
||||
"version": "${{ github.event.release.tag_name }}"
|
||||
}
|
||||
|
||||
publish-stable:
|
||||
name: 📢 Publish to stable repository
|
||||
if: needs.information.outputs.environment == 'stable'
|
||||
needs:
|
||||
- information
|
||||
- deploy
|
||||
environment:
|
||||
name: ${{ needs.information.outputs.environment }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Dispatch repository updater update signal
|
||||
uses: peter-evans/repository-dispatch@v1.1.3
|
||||
with:
|
||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||
repository: hassio-addons/repository
|
||||
event-type: update
|
||||
client-payload: >
|
||||
{
|
||||
"addon": "${{ needs.information.outputs.slug }}",
|
||||
"name": "${{ needs.information.outputs.name }}",
|
||||
"repository": "${{ github.repository }}",
|
||||
"version": "${{ github.event.release.tag_name }}"
|
||||
}
|
22
.github/workflows/labels.yaml
vendored
Normal file
22
.github/workflows/labels.yaml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
name: Sync labels
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/labels.yml
|
||||
|
||||
jobs:
|
||||
labels:
|
||||
name: ♻️ Sync labels
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: 🚀 Run Label Syncer
|
||||
uses: micnncim/action-label-syncer@v1.2.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
21
.github/workflows/lock.yaml
vendored
Normal file
21
.github/workflows/lock.yaml
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
name: Lock
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 9 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
name: 🔒 Lock closed issues and PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2.0.3
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-lock-inactive-days: "30"
|
||||
issue-lock-reason: ""
|
||||
pr-lock-inactive-days: "1"
|
||||
pr-lock-reason: ""
|
18
.github/workflows/release-drafter.yaml
vendored
Normal file
18
.github/workflows/release-drafter.yaml
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
name: Release Drafter
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
name: ✏️ Draft release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Run Release Drafter
|
||||
uses: release-drafter/release-drafter@v5.13.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
40
.github/workflows/stale.yaml
vendored
Normal file
40
.github/workflows/stale.yaml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
name: Stale
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 8 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
name: 🧹 Clean up stale issues and PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Run stale
|
||||
uses: actions/stale@v3.0.15
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
remove-stale-when-updated: true
|
||||
stale-issue-label: "stale"
|
||||
exempt-issue-labels: "no-stale,help-wanted"
|
||||
stale-issue-message: >
|
||||
There hasn't been any activity on this issue recently, so we
|
||||
clean up some of the older and inactive issues.
|
||||
|
||||
Please make sure to update to the latest version and
|
||||
check if that solves the issue. Let us know if that works for you
|
||||
by leaving a comment 👍
|
||||
|
||||
This issue has now been marked as stale and will be closed if no
|
||||
further activity occurs. Thanks!
|
||||
stale-pr-label: "stale"
|
||||
exempt-pr-labels: "no-stale"
|
||||
stale-pr-message: >
|
||||
There hasn't been any activity on this pull request recently. This
|
||||
pull request has been automatically marked as stale because of that
|
||||
and will be closed if no further activity occurs within 7 days.
|
||||
Thank you for your contributions.
|
1
.mdlrc
Normal file
1
.mdlrc
Normal file
|
@ -0,0 +1 @@
|
|||
rules "~MD024"
|
66
.yamllint
Normal file
66
.yamllint
Normal file
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
rules:
|
||||
braces:
|
||||
level: error
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 1
|
||||
min-spaces-inside-empty: -1
|
||||
max-spaces-inside-empty: -1
|
||||
brackets:
|
||||
level: error
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 0
|
||||
min-spaces-inside-empty: -1
|
||||
max-spaces-inside-empty: -1
|
||||
colons:
|
||||
level: error
|
||||
max-spaces-before: 0
|
||||
max-spaces-after: 1
|
||||
commas:
|
||||
level: error
|
||||
max-spaces-before: 0
|
||||
min-spaces-after: 1
|
||||
max-spaces-after: 1
|
||||
comments:
|
||||
level: error
|
||||
require-starting-space: true
|
||||
min-spaces-from-content: 2
|
||||
comments-indentation:
|
||||
level: error
|
||||
document-end:
|
||||
level: error
|
||||
present: false
|
||||
document-start:
|
||||
level: error
|
||||
present: true
|
||||
empty-lines:
|
||||
level: error
|
||||
max: 1
|
||||
max-start: 0
|
||||
max-end: 1
|
||||
hyphens:
|
||||
level: error
|
||||
max-spaces-after: 1
|
||||
indentation:
|
||||
level: error
|
||||
spaces: 2
|
||||
indent-sequences: true
|
||||
check-multi-line-strings: false
|
||||
key-duplicates:
|
||||
level: error
|
||||
line-length:
|
||||
ignore: |
|
||||
.github/support.yml
|
||||
level: warning
|
||||
max: 120
|
||||
allow-non-breakable-words: true
|
||||
allow-non-breakable-inline-mappings: true
|
||||
new-line-at-end-of-file:
|
||||
level: error
|
||||
new-lines:
|
||||
level: error
|
||||
type: unix
|
||||
trailing-spaces:
|
||||
level: error
|
||||
truthy:
|
||||
level: error
|
133
CODE_OF_CONDUCT.md
Normal file
133
CODE_OF_CONDUCT.md
Normal file
|
@ -0,0 +1,133 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
frenck@frenck.dev.
|
||||
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][mozilla coc].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][faq]. Translations are available
|
||||
at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||
[mozilla coc]: https://github.com/mozilla/diversity
|
||||
[faq]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
29
CONTRIBUTING.md
Normal file
29
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish
|
||||
to make via issue, email, or any other method with the owners of this repository
|
||||
before making a change.
|
||||
|
||||
Please note we have a code of conduct, please follow it in all your interactions
|
||||
with the project.
|
||||
|
||||
## Issues and feature requests
|
||||
|
||||
You've found a bug in the source code, a mistake in the documentation or maybe
|
||||
you'd like a new feature? You can help us by submitting an issue to our
|
||||
[GitHub Repository][github]. Before you create an issue, make sure you search
|
||||
the archive, maybe your question was already answered.
|
||||
|
||||
Even better: You could submit a pull request with a fix / new feature!
|
||||
|
||||
## Pull request process
|
||||
|
||||
1. Search our repository for open or closed [pull requests][prs] that relates
|
||||
to your submission. You don't want to duplicate effort.
|
||||
|
||||
1. You may merge the pull request in once you have the sign-off of two other
|
||||
developers, or if you do not have permission to do that, you may request
|
||||
the second reviewer to merge it for you.
|
||||
|
||||
[github]: https://github.com/hassio-addons/addon-zwavejs2mqtt/issues
|
||||
[prs]: https://github.com/hassio-addons/addon-zwavejs2mqtt/pulls
|
21
LICENSE.md
Normal file
21
LICENSE.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# MIT License
|
||||
|
||||
Copyright (c) 2021 Franck Nijhof
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
141
README.md
Normal file
141
README.md
Normal file
|
@ -0,0 +1,141 @@
|
|||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
|
||||
[![GitHub Release][releases-shield]][releases]
|
||||
![Project Stage][project-stage-shield]
|
||||
[![License][license-shield]](LICENSE.md)
|
||||
|
||||
![Supports armhf Architecture][armhf-shield]
|
||||
![Supports armv7 Architecture][armv7-shield]
|
||||
![Supports aarch64 Architecture][aarch64-shield]
|
||||
![Supports amd64 Architecture][amd64-shield]
|
||||
![Supports i386 Architecture][i386-shield]
|
||||
|
||||
[![Github Actions][github-actions-shield]][github-actions]
|
||||
![Project Maintenance][maintenance-shield]
|
||||
[![GitHub Activity][commits-shield]][commits]
|
||||
|
||||
[![Discord][discord-shield]][discord]
|
||||
[![Community Forum][forum-shield]][forum]
|
||||
|
||||
[![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors]
|
||||
|
||||
[![Support Frenck on Patreon][patreon-shield]][patreon]
|
||||
|
||||
Fully configurable Z-Wave JS to MQTT gateway and control panel.
|
||||
|
||||

|
||||
|
||||
## About
|
||||
|
||||
The Z-Wave JS to MQTT add-on allows you to decouple your Z-Wave network from
|
||||
your Home Assistant instance by leveraging your MQTT broker. It ships with
|
||||
a web-based control panel, allowing you to configure every aspect of your
|
||||
Z-Wave network and how they are published in MQTT.
|
||||
|
||||
Some advantages and use-cases for this are:
|
||||
|
||||
- Compatible with the Home Assistant Z-Wave JS integration.
|
||||
- Your Z-Wave network will keep running between Home Assistant restarts.
|
||||
- You can directly use things like Node-RED with your Z-Wave network, while
|
||||
it is available for Home Assistant at the same time.
|
||||
- Allow [ESPHome.io][esphome] based ESP devices to directly respond or work
|
||||
with your Z-Wave network.
|
||||
|
||||
This add-on uses the [Zwavejs2Mqtt][zwavejs2mqtt] software.
|
||||
|
||||
[:books: Read the full add-on documentation][docs]
|
||||
|
||||
## Support
|
||||
|
||||
Got questions?
|
||||
|
||||
You have several options to get them answered:
|
||||
|
||||
- The [Home Assistant Community Add-ons Discord chat server][discord] for add-on
|
||||
support and feature requests.
|
||||
- The [Home Assistant Discord chat server][discord-ha] for general Home
|
||||
Assistant discussions and questions.
|
||||
- The Home Assistant [Community Forum][forum].
|
||||
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
|
||||
|
||||
You could also [open an issue here][issue] GitHub.
|
||||
|
||||
## Contributing
|
||||
|
||||
This is an active open-source project. We are always open to people who want to
|
||||
use the code or contribute to it.
|
||||
|
||||
We have set up a separate document containing our
|
||||
[contribution guidelines](CONTRIBUTING.md).
|
||||
|
||||
Thank you for being involved! :heart_eyes:
|
||||
|
||||
## Authors & contributors
|
||||
|
||||
The original setup of this repository is by [Franck Nijhof][frenck].
|
||||
|
||||
For a full list of all authors and contributors,
|
||||
check [the contributor's page][contributors].
|
||||
|
||||
## We have got some Home Assistant add-ons for you
|
||||
|
||||
Want some more functionality to your Home Assistant instance?
|
||||
|
||||
We have created multiple add-ons for Home Assistant. For a full list, check out
|
||||
our [GitHub Repository][repository].
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Franck Nijhof
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
|
||||
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
|
||||
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
|
||||
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
|
||||
[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-zwavejs2mqtt.svg
|
||||
[commits]: https://github.com/hassio-addons/addon-zwavejs2mqtt/commits/main
|
||||
[contributors]: https://github.com/hassio-addons/addon-zwavejs2mqtt/graphs/contributors
|
||||
[discord-ha]: https://discord.gg/c5DvZ4e
|
||||
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[docs]: https://github.com/hassio-addons/addon-zwavejs2mqtt/blob/main/zwavejs2mqtt/DOCS.md
|
||||
[esphome]: https://esphome.io/components/mqtt.html#on-message-trigger
|
||||
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
|
||||
[forum]: https://community.home-assistant.io/?u=frenck
|
||||
[frenck]: https://github.com/frenck
|
||||
[github-actions-shield]: https://github.com/hassio-addons/addon-zwavejs2mqtt/workflows/CI/badge.svg
|
||||
[github-actions]: https://github.com/hassio-addons/addon-zwavejs2mqtts/actions
|
||||
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
|
||||
[github-sponsors]: https://github.com/sponsors/frenck
|
||||
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
|
||||
[issue]: https://github.com/hassio-addons/addon-zwavejs2mqtt/issues
|
||||
[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-zwavejs2mqtt.svg
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
|
||||
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
|
||||
[patreon]: https://www.patreon.com/frenck
|
||||
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
|
||||
[reddit]: https://reddit.com/r/homeassistant
|
||||
[releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-zwavejs2mqtt.svg
|
||||
[releases]: https://github.com/hassio-addons/addon-zwavejs2mqtt/releases
|
||||
[repository]: https://github.com/hassio-addons/repository
|
||||
[zwavejs2mqtt]: https://github.com/zwave-js/zwavejs2mqtt
|
83
zwavejs2mqtt/.README.j2
Normal file
83
zwavejs2mqtt/.README.j2
Normal file
|
@ -0,0 +1,83 @@
|
|||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
|
||||
[![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]
|
||||
|
||||
[![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum]
|
||||
|
||||
[![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors]
|
||||
|
||||
[![Support Frenck on Patreon][patreon-shield]][patreon]
|
||||
|
||||
Fully configurable Z-Wave JS to MQTT gateway and control panel.
|
||||
|
||||
![Z-Wave JS to MQTT][logo]
|
||||
|
||||
## About
|
||||
|
||||
The Z-Wave JS to MQTT add-on allows you to decouple your Z-Wave network from
|
||||
your Home Assistant instance by leveraging your MQTT broker. It ships with
|
||||
a web-based control panel, allowing you to configure every aspect of your
|
||||
Z-Wave network and how they are published in MQTT.
|
||||
|
||||
Some advantages and use-cases for this are:
|
||||
|
||||
- Compatible with the Home Assistant Z-Wave JS integration.
|
||||
- Your Z-Wave network will keep running between Home Assistant restarts.
|
||||
- You can directly use things like Node-RED with your Z-Wave network, while
|
||||
it is available for Home Assistant at the same time.
|
||||
- Allow [ESPHome.io][esphome] based ESP devices to directly respond or work
|
||||
with your Z-Wave network.
|
||||
|
||||
{% if channel == "edge" %}
|
||||
## WARNING! THIS IS AN EDGE VERSION!
|
||||
|
||||
This Home Assistant Add-ons repository contains edge builds of add-ons.
|
||||
Edge builds add-ons are based upon the latest development version.
|
||||
|
||||
- They may not work at all.
|
||||
- They might stop working at any time.
|
||||
- They could have a negative impact on your system.
|
||||
|
||||
This repository was created for:
|
||||
|
||||
- Anybody willing to test.
|
||||
- Anybody interested in trying out upcoming add-ons or add-on features.
|
||||
- Developers.
|
||||
|
||||
If you are more interested in stable releases of our add-ons:
|
||||
|
||||
<https://github.com/hassio-addons/repository>
|
||||
|
||||
{% endif %}
|
||||
{% if channel == "beta" %}
|
||||
## WARNING! THIS IS A BETA VERSION!
|
||||
|
||||
This Home Assistant Add-ons repository contains beta releases of add-ons.
|
||||
|
||||
- They might stop working at any time.
|
||||
- They could have a negative impact on your system.
|
||||
|
||||
This repository was created for:
|
||||
|
||||
- Anybody willing to test.
|
||||
- Anybody interested in trying out upcoming add-ons or add-on features.
|
||||
|
||||
If you are more interested in stable releases of our add-ons:
|
||||
|
||||
<https://github.com/hassio-addons/repository>
|
||||
|
||||
{% endif %}
|
||||
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[esphome]: https://esphome.io/components/mqtt.html#on-message-trigger
|
||||
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
|
||||
[forum]: https://community.home-assistant.io/?u=frenck
|
||||
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
|
||||
[github-sponsors]: https://github.com/sponsors/frenck
|
||||
[logo]: https://github.com/hassio-addons/addon-zwavejs2mqtt/raw/main/zwavejs2mqtt/logo.png
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
|
||||
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
|
||||
[patreon]: https://www.patreon.com/frenck
|
||||
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
|
||||
[release-shield]: https://img.shields.io/badge/version-{{ version }}-blue.svg
|
||||
[release]: {{ repo }}/tree/{{ version }}
|
139
zwavejs2mqtt/DOCS.md
Normal file
139
zwavejs2mqtt/DOCS.md
Normal file
|
@ -0,0 +1,139 @@
|
|||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
|
||||
The Z-Wave JS to MQTT add-on allows you to decouple your Z-Wave network from
|
||||
your Home Assistant instance by leveraging your MQTT broker. It ships with
|
||||
a web-based control panel, allowing you to configure every aspect of your
|
||||
Z-Wave network and how they are published in MQTT.
|
||||
|
||||
Some advantages and use-cases for this are:
|
||||
|
||||
- Compatible with the Home Assistant Z-Wave JS integration.
|
||||
- Your Z-Wave network will keep running between Home Assistant restarts.
|
||||
- You can directly use things like Node-RED with your Z-Wave network, while
|
||||
it is available for Home Assistant at the same time.
|
||||
- Allow [ESPHome.io][esphome] based ESP devices to directly respond or work
|
||||
with your Z-Wave network.
|
||||
|
||||
This add-on uses the [Zwavejs2Mqtt][zwavejs2mqtt] software.
|
||||
|
||||
[:books: Read the full add-on documentation][docs]
|
||||
|
||||
## Installation
|
||||
|
||||
The installation of this add-on is pretty straightforward and not different in
|
||||
comparison to installing any other Home Assistant add-on.
|
||||
|
||||
1. Search for the "Z-Wave JS to MQTT" add-on in the Supervisor add-on store
|
||||
and install it.
|
||||
1. Start the "Z-Wave JS to MQTT" add-on.
|
||||
1. Check the logs of the "Z-Wave JS to MQTT" add-on to see if everything went
|
||||
well.
|
||||
1. Click the "OPEN WEB UI" button.
|
||||
1. Enjoy the add-on!
|
||||
|
||||
**NOTE**: The upstream project has documentation on using the software itself:
|
||||
<https://zwave-js.github.io/zwavejs2mqtt/#/>
|
||||
|
||||
## Configuration
|
||||
|
||||
**Note**: _Remember to restart the add-on when the configuration is changed._
|
||||
|
||||
Example add-on configuration:
|
||||
|
||||
```yaml
|
||||
log_level: info
|
||||
```
|
||||
|
||||
### Option: `log_level`
|
||||
|
||||
The `log_level` option controls the level of log output by the addon and can
|
||||
be changed to be more or less verbose, which might be useful when you are
|
||||
dealing with an unknown issue. Possible values are:
|
||||
|
||||
- `trace`: Show every detail, like all called internal functions.
|
||||
- `debug`: Shows detailed debug information.
|
||||
- `info`: Normal (usually) interesting events.
|
||||
- `warning`: Exceptional occurrences that are not errors.
|
||||
- `error`: Runtime errors that do not require immediate action.
|
||||
- `fatal`: Something went terribly wrong. Add-on becomes unusable.
|
||||
|
||||
Please note that each level automatically includes log messages from a
|
||||
more severe level, e.g., `debug` also shows `info` messages. By default,
|
||||
the `log_level` is set to `info`, which is the recommended setting unless
|
||||
you are troubleshooting.
|
||||
|
||||
## Known issues and limitations
|
||||
|
||||
- None at this point.
|
||||
|
||||
## Changelog & Releases
|
||||
|
||||
This repository keeps a change log using [GitHub's releases][releases]
|
||||
functionality.
|
||||
|
||||
Releases are based on [Semantic Versioning][semver], and use the format
|
||||
of `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented
|
||||
based on the following:
|
||||
|
||||
- `MAJOR`: Incompatible or major changes.
|
||||
- `MINOR`: Backwards-compatible new features and enhancements.
|
||||
- `PATCH`: Backwards-compatible bugfixes and package updates.
|
||||
|
||||
## Support
|
||||
|
||||
Got questions?
|
||||
|
||||
You have several options to get them answered:
|
||||
|
||||
- The [Home Assistant Community Add-ons Discord chat server][discord] for add-on
|
||||
support and feature requests.
|
||||
- The [Home Assistant Discord chat server][discord-ha] for general Home
|
||||
Assistant discussions and questions.
|
||||
- The Home Assistant [Community Forum][forum].
|
||||
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
|
||||
|
||||
You could also [open an issue here][issue] GitHub.
|
||||
|
||||
## Authors & contributors
|
||||
|
||||
The original setup of this repository is by [Franck Nijhof][frenck].
|
||||
|
||||
For a full list of all authors and contributors,
|
||||
check [the contributor's page][contributors].
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Franck Nijhof
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
[contributors]: https://github.com/hassio-addons/addon-zwavejs2mqtt/graphs/contributors
|
||||
[discord-ha]: https://discord.gg/c5DvZ4e
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[esphome]: https://esphome.io/components/mqtt.html#on-message-trigger
|
||||
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
|
||||
[forum]: https://community.home-assistant.io/?u=frenck
|
||||
[frenck]: https://github.com/frenck
|
||||
[issue]: https://github.com/hassio-addons/addon-zwavejs2mqtt/issues
|
||||
[reddit]: https://reddit.com/r/homeassistant
|
||||
[releases]: https://github.com/hassio-addons/addon-zwavejs2mqtt/releases
|
||||
[semver]: http://semver.org/spec/v2.0.0.htm
|
||||
[zwavejs2mqtt]: https://github.com/zwave-js/zwavejs2mqtt
|
104
zwavejs2mqtt/Dockerfile
Executable file
104
zwavejs2mqtt/Dockerfile
Executable file
|
@ -0,0 +1,104 @@
|
|||
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:9.1.1
|
||||
# hadolint ignore=DL3006
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
# Set shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Setup base
|
||||
# hadolint ignore=DL3003
|
||||
RUN \
|
||||
apk add --no-cache --virtual .build-dependencies \
|
||||
build-base=0.5-r2 \
|
||||
linux-headers=5.7.8-r0 \
|
||||
npm=14.15.4-r0 \
|
||||
python3-dev=3.8.7-r0 \
|
||||
yarn=1.22.10-r0 \
|
||||
\
|
||||
&& apk add --no-cache \
|
||||
eudev=3.2.9-r3 \
|
||||
libusb=1.0.24-r0 \
|
||||
nginx=1.18.0-r13 \
|
||||
nodejs=14.15.4-r0 \
|
||||
\
|
||||
&& curl -J -L -o /tmp/zwavejs2mqtt.tar.gz \
|
||||
"https://github.com/zwave-js/zwavejs2mqtt/archive/a465c6c1197a05fd56732f0e309f8ba78f3d465d.tar.gz" \
|
||||
&& tar zxvf \
|
||||
/tmp/zwavejs2mqtt.tar.gz \
|
||||
--strip 1 -C /opt \
|
||||
\
|
||||
&& cd /opt \
|
||||
&& npm config set unsafe-perm \
|
||||
&& npm install \
|
||||
&& npm run build \
|
||||
&& npm prune --production \
|
||||
\
|
||||
&& curl -J -L -o /tmp/zwavejs.tar.gz \
|
||||
"https://github.com/zwave-js/node-zwave-js/archive/9823b6cb22f99d4533b0ba0ce5d427c6d385317d.tar.gz" \
|
||||
&& mkdir /tmp/zwavejs \
|
||||
&& tar zxvf \
|
||||
/tmp/zwavejs.tar.gz \
|
||||
--strip 1 -C /tmp/zwavejs \
|
||||
\
|
||||
&& rm -f -r /opt/node_modules/@zwave-js/config/config/devices/* \
|
||||
&& mv /tmp/zwavejs/packages/config/config/devices/* /opt/node_modules/@zwave-js/config/config/devices/ \
|
||||
\
|
||||
&& apk del --no-cache --purge .build-dependencies \
|
||||
\
|
||||
&& rm -f -r \
|
||||
/etc/nginx \
|
||||
/opt/build \
|
||||
/opt/index.html \
|
||||
/opt/package-lock.json \
|
||||
/opt/package.sh \
|
||||
/opt/src \
|
||||
/opt/static \
|
||||
/opt/stylesheets \
|
||||
/opt/.[!.]* \
|
||||
/opt/*.md \
|
||||
/opt/nodemon.json \
|
||||
/opt/kustomization.yaml \
|
||||
/opt/kubernetes \
|
||||
/opt/docker \
|
||||
/opt/docs \
|
||||
/root/.cache \
|
||||
/root/.config \
|
||||
/root/.npmrc \
|
||||
/root/.node-gyp \
|
||||
/root/.npm \
|
||||
/tmp/.[!.]* \
|
||||
/tmp/* \
|
||||
/usr/lib/node_modules \
|
||||
/usr/local/share/.cache
|
||||
|
||||
# Copy root filesystem
|
||||
COPY rootfs /
|
||||
|
||||
# Build arguments
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
ARG BUILD_NAME
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_REPOSITORY
|
||||
ARG BUILD_VERSION
|
||||
|
||||
# Labels
|
||||
LABEL \
|
||||
io.hass.name="${BUILD_NAME}" \
|
||||
io.hass.description="${BUILD_DESCRIPTION}" \
|
||||
io.hass.arch="${BUILD_ARCH}" \
|
||||
io.hass.type="addon" \
|
||||
io.hass.version=${BUILD_VERSION} \
|
||||
maintainer="Franck Nijhof <frenck@addons.community>" \
|
||||
org.opencontainers.image.title="${BUILD_NAME}" \
|
||||
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
|
||||
org.opencontainers.image.vendor="Home Assistant Community Add-ons" \
|
||||
org.opencontainers.image.authors="Franck Nijhof <frenck@addons.community>" \
|
||||
org.opencontainers.image.licenses="MIT" \
|
||||
org.opencontainers.image.url="https://addons.community" \
|
||||
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
|
||||
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
|
||||
org.opencontainers.image.created=${BUILD_DATE} \
|
||||
org.opencontainers.image.revision=${BUILD_REF} \
|
||||
org.opencontainers.image.version=${BUILD_VERSION}
|
9
zwavejs2mqtt/build.json
Normal file
9
zwavejs2mqtt/build.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"build_from": {
|
||||
"aarch64": "ghcr.io/hassio-addons/base/aarch64:9.1.1",
|
||||
"amd64": "ghcr.io/hassio-addons/base/amd64:9.1.1",
|
||||
"armhf": "ghcr.io/hassio-addons/base/armhf:9.1.1",
|
||||
"armv7": "ghcr.io/hassio-addons/base/armv7:9.1.1",
|
||||
"i386": "ghcr.io/hassio-addons/base/i386:9.1.1"
|
||||
}
|
||||
}
|
19
zwavejs2mqtt/config.json
Executable file
19
zwavejs2mqtt/config.json
Executable file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "Z-Wave JS to MQTT",
|
||||
"version": "dev",
|
||||
"slug": "zwavejs2mqtt",
|
||||
"description": "Fully configurable Z-Wave JS to MQTT gateway and control panel",
|
||||
"url": "https://github.com/hassio-addons/addon-zwavejs2mqtt",
|
||||
"ingress": true,
|
||||
"panel_title": "Z-Wave JS",
|
||||
"panel_icon": "mdi:z-wave",
|
||||
"startup": "system",
|
||||
"init": false,
|
||||
"arch": ["aarch64", "amd64", "armhf", "armv7", "i386"],
|
||||
"discovery": ["zwave_js"],
|
||||
"auto_uart": true,
|
||||
"map": ["share:rw"],
|
||||
"schema": {
|
||||
"log_level": "list(trace|debug|info|notice|warning|error|fatal)?"
|
||||
}
|
||||
}
|
BIN
zwavejs2mqtt/icon.png
Normal file
BIN
zwavejs2mqtt/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6 KiB |
BIN
zwavejs2mqtt/logo.png
Normal file
BIN
zwavejs2mqtt/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
8
zwavejs2mqtt/rootfs/etc/cont-init.d/folders.sh
Normal file
8
zwavejs2mqtt/rootfs/etc/cont-init.d/folders.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Creates store folder if it doesn't exists yet
|
||||
# ==============================================================================
|
||||
if ! bashio::fs.directory_exists "/data/store"; then
|
||||
mkdir /data/store
|
||||
fi
|
10
zwavejs2mqtt/rootfs/etc/cont-init.d/nginx.sh
Normal file
10
zwavejs2mqtt/rootfs/etc/cont-init.d/nginx.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Configures NGINX for use with this add-on.
|
||||
# ==============================================================================
|
||||
bashio::var.json \
|
||||
entry "$(bashio::addon.ingress_entry)" \
|
||||
| tempio \
|
||||
-template /etc/nginx/templates/ingress.gtpl \
|
||||
-out /etc/nginx/servers/ingress.conf
|
96
zwavejs2mqtt/rootfs/etc/nginx/includes/mime.types
Normal file
96
zwavejs2mqtt/rootfs/etc/nginx/includes/mime.types
Normal file
|
@ -0,0 +1,96 @@
|
|||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
text/xml xml;
|
||||
image/gif gif;
|
||||
image/jpeg jpeg jpg;
|
||||
application/javascript js;
|
||||
application/atom+xml atom;
|
||||
application/rss+xml rss;
|
||||
|
||||
text/mathml mml;
|
||||
text/plain txt;
|
||||
text/vnd.sun.j2me.app-descriptor jad;
|
||||
text/vnd.wap.wml wml;
|
||||
text/x-component htc;
|
||||
|
||||
image/png png;
|
||||
image/svg+xml svg svgz;
|
||||
image/tiff tif tiff;
|
||||
image/vnd.wap.wbmp wbmp;
|
||||
image/webp webp;
|
||||
image/x-icon ico;
|
||||
image/x-jng jng;
|
||||
image/x-ms-bmp bmp;
|
||||
|
||||
font/woff woff;
|
||||
font/woff2 woff2;
|
||||
|
||||
application/java-archive jar war ear;
|
||||
application/json json;
|
||||
application/mac-binhex40 hqx;
|
||||
application/msword doc;
|
||||
application/pdf pdf;
|
||||
application/postscript ps eps ai;
|
||||
application/rtf rtf;
|
||||
application/vnd.apple.mpegurl m3u8;
|
||||
application/vnd.google-earth.kml+xml kml;
|
||||
application/vnd.google-earth.kmz kmz;
|
||||
application/vnd.ms-excel xls;
|
||||
application/vnd.ms-fontobject eot;
|
||||
application/vnd.ms-powerpoint ppt;
|
||||
application/vnd.oasis.opendocument.graphics odg;
|
||||
application/vnd.oasis.opendocument.presentation odp;
|
||||
application/vnd.oasis.opendocument.spreadsheet ods;
|
||||
application/vnd.oasis.opendocument.text odt;
|
||||
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||
pptx;
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||
xlsx;
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||
docx;
|
||||
application/vnd.wap.wmlc wmlc;
|
||||
application/x-7z-compressed 7z;
|
||||
application/x-cocoa cco;
|
||||
application/x-java-archive-diff jardiff;
|
||||
application/x-java-jnlp-file jnlp;
|
||||
application/x-makeself run;
|
||||
application/x-perl pl pm;
|
||||
application/x-pilot prc pdb;
|
||||
application/x-rar-compressed rar;
|
||||
application/x-redhat-package-manager rpm;
|
||||
application/x-sea sea;
|
||||
application/x-shockwave-flash swf;
|
||||
application/x-stuffit sit;
|
||||
application/x-tcl tcl tk;
|
||||
application/x-x509-ca-cert der pem crt;
|
||||
application/x-xpinstall xpi;
|
||||
application/xhtml+xml xhtml;
|
||||
application/xspf+xml xspf;
|
||||
application/zip zip;
|
||||
|
||||
application/octet-stream bin exe dll;
|
||||
application/octet-stream deb;
|
||||
application/octet-stream dmg;
|
||||
application/octet-stream iso img;
|
||||
application/octet-stream msi msp msm;
|
||||
|
||||
audio/midi mid midi kar;
|
||||
audio/mpeg mp3;
|
||||
audio/ogg ogg;
|
||||
audio/x-m4a m4a;
|
||||
audio/x-realaudio ra;
|
||||
|
||||
video/3gpp 3gpp 3gp;
|
||||
video/mp2t ts;
|
||||
video/mp4 mp4;
|
||||
video/mpeg mpeg mpg;
|
||||
video/quicktime mov;
|
||||
video/webm webm;
|
||||
video/x-flv flv;
|
||||
video/x-m4v m4v;
|
||||
video/x-mng mng;
|
||||
video/x-ms-asf asx asf;
|
||||
video/x-ms-wmv wmv;
|
||||
video/x-msvideo avi;
|
||||
}
|
15
zwavejs2mqtt/rootfs/etc/nginx/includes/proxy_params.conf
Normal file
15
zwavejs2mqtt/rootfs/etc/nginx/includes/proxy_params.conf
Normal file
|
@ -0,0 +1,15 @@
|
|||
proxy_http_version 1.1;
|
||||
proxy_ignore_client_abort off;
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_redirect off;
|
||||
proxy_send_timeout 86400s;
|
||||
proxy_max_temp_file_size 0;
|
||||
|
||||
proxy_set_header Accept-Encoding "";
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
|
@ -0,0 +1,6 @@
|
|||
root /dev/null;
|
||||
server_name $hostname;
|
||||
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
3
zwavejs2mqtt/rootfs/etc/nginx/includes/upstream.conf
Normal file
3
zwavejs2mqtt/rootfs/etc/nginx/includes/upstream.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
upstream backend {
|
||||
server 127.0.0.1:44920;
|
||||
}
|
44
zwavejs2mqtt/rootfs/etc/nginx/nginx.conf
Normal file
44
zwavejs2mqtt/rootfs/etc/nginx/nginx.conf
Normal file
|
@ -0,0 +1,44 @@
|
|||
# Run nginx in foreground.
|
||||
daemon off;
|
||||
|
||||
# This is run inside Docker.
|
||||
user root;
|
||||
|
||||
# Pid storage location.
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
# Set number of worker processes.
|
||||
worker_processes 1;
|
||||
|
||||
# Enables the use of JIT for regular expressions to speed-up their processing.
|
||||
pcre_jit on;
|
||||
|
||||
# Write error log to the add-on log.
|
||||
error_log /proc/1/fd/1 error;
|
||||
|
||||
# Max num of simultaneous connections by a worker process.
|
||||
events {
|
||||
worker_connections 512;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/includes/mime.types;
|
||||
|
||||
access_log off;
|
||||
client_max_body_size 4G;
|
||||
default_type application/octet-stream;
|
||||
gzip on;
|
||||
keepalive_timeout 65;
|
||||
sendfile on;
|
||||
server_tokens off;
|
||||
tcp_nodelay on;
|
||||
tcp_nopush on;
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
include /etc/nginx/includes/upstream.conf;
|
||||
include /etc/nginx/servers/*.conf;
|
||||
}
|
1
zwavejs2mqtt/rootfs/etc/nginx/servers/.gitkeep
Normal file
1
zwavejs2mqtt/rootfs/etc/nginx/servers/.gitkeep
Normal file
|
@ -0,0 +1 @@
|
|||
Without requirements or design, programming is the art of adding bugs to an empty text file. (Louis Srygley)
|
14
zwavejs2mqtt/rootfs/etc/nginx/templates/ingress.gtpl
Normal file
14
zwavejs2mqtt/rootfs/etc/nginx/templates/ingress.gtpl
Normal file
|
@ -0,0 +1,14 @@
|
|||
server {
|
||||
listen 8099 default_server;
|
||||
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
|
||||
location / {
|
||||
allow 172.30.32.2;
|
||||
deny all;
|
||||
|
||||
proxy_pass http://backend;
|
||||
proxy_set_header X-External-Path {{ .entry }};
|
||||
}
|
||||
}
|
9
zwavejs2mqtt/rootfs/etc/services.d/nginx/finish
Normal file
9
zwavejs2mqtt/rootfs/etc/services.d/nginx/finish
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Take down the S6 supervision tree when Nginx fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
11
zwavejs2mqtt/rootfs/etc/services.d/nginx/run
Normal file
11
zwavejs2mqtt/rootfs/etc/services.d/nginx/run
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Runs the Nginx daemon
|
||||
# ==============================================================================
|
||||
|
||||
# Wait for zwavejs2mqtt to be available
|
||||
bashio::net.wait_for 44920
|
||||
|
||||
bashio::log.info "Starting NGinx..."
|
||||
exec nginx
|
25
zwavejs2mqtt/rootfs/etc/services.d/zwavejs2mqtt/discovery
Executable file
25
zwavejs2mqtt/rootfs/etc/services.d/zwavejs2mqtt/discovery
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Send zwave_js discovery information to Home Assistant
|
||||
# ==============================================================================
|
||||
declare payload
|
||||
|
||||
# Wait for zwavejs2mqtt to be available
|
||||
bashio::net.wait_for 44920
|
||||
|
||||
# Wait some more
|
||||
sleep 10
|
||||
|
||||
# Prepare discovery payload
|
||||
payload=$(\
|
||||
bashio::var.json \
|
||||
host "$(hostname)" \
|
||||
port "^3000" \
|
||||
)
|
||||
|
||||
if bashio::discovery "zwave_js" "${payload}" > /dev/null; then
|
||||
bashio::log.info "Successfully send discovery information to Home Assistant."
|
||||
else
|
||||
bashio::log.error "Discovery message to Home Assistant failed!"
|
||||
fi
|
9
zwavejs2mqtt/rootfs/etc/services.d/zwavejs2mqtt/finish
Normal file
9
zwavejs2mqtt/rootfs/etc/services.d/zwavejs2mqtt/finish
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Take down the S6 supervision tree when zwavejs2mqtt fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
18
zwavejs2mqtt/rootfs/etc/services.d/zwavejs2mqtt/run
Executable file
18
zwavejs2mqtt/rootfs/etc/services.d/zwavejs2mqtt/run
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Z-Wave JS to MQTT
|
||||
# Starts zwavejs2mqtt
|
||||
# ==============================================================================
|
||||
bashio::log.info "Starting the Z-Wave JS to MQTT..."
|
||||
|
||||
export NODE_ENV=production
|
||||
export PORT=44920
|
||||
export STORE_DIR=/data/store
|
||||
|
||||
# Send out discovery information to Home Assistant
|
||||
./discovery &
|
||||
|
||||
cd /opt/ \
|
||||
|| bashio::exit.nok "Could not change directory to application"
|
||||
|
||||
exec node bin/www
|
Loading…
Add table
Add a link
Reference in a new issue