diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..33707b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,42 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' +--- + + + +**Checklist:** + +- [ ] I updated to the latest version available +- [ ] I cleared the cache of my browser + +**Release with the issue:** + +**Last working release (if known):** + +**Browser and Operating System:** + + + +**Description of problem:** + + + +**Javascript errors shown in the web inspector (if applicable):** + +``` + +``` + +**Additional information:** \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..aec8ede --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: feature request +assignees: '' +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2e6f61f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: "Build" + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + name: Test build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Cache Dependencies + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install Dependencies + run: npm ci + - name: Build + run: npm run build + - uses: actions/upload-artifact@v1 + with: + name: settings-sync.js + path: dist/settings-sync.js \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bafbd68 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + release: + types: [published] + +jobs: + release: + name: Prepare release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + # Build + - name: Cache Dependencies + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install Dependencies + run: npm ci + - name: Build + run: npm run build + + # Upload build file to the releas as an asset. + - name: Upload zip to release + uses: svenstaro/upload-release-action@v1-release + + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/settings-sync.js + asset_name: settings-sync.js + tag: ${{ github.ref }} + overwrite: true \ No newline at end of file diff --git a/README.md b/README.md index e4f16f8..b0fc7e0 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ resources: | type | string | **Required** | `custom:custom:settings-sync` | | enabled | boolean | **Required** | Enable card | | sensor | sensor | **Required** | The Sensor that holds the User Settings JSON retrieved by the REST API | -| username | string | **Optional** | Optional Username or default is the Logged In User | +| username | string | **Optional** | Optional Username or default is the Logged In User (this matches up with the JSON) | [commits-shield]: https://img.shields.io/github/commit-activity/y/ajagnanan/ha-settings-sync.svg?style=for-the-badge [commits]: https://github.com/ajagnanan/ha-settings-sync/commits/master @@ -39,6 +39,15 @@ resources: [releases-shield]: https://img.shields.io/github/release/ajagnanan/ha-settings-sync.svg?style=for-the-badge [releases]: https://github.com/ajagnanan/ha-settings-sync/releases +## Configuration + +```yaml +type: custom:settings-sync +enabled: true +sensor: sensor.settings_sync +username: admin +``` + ## References Project based on: https://community.home-assistant.io/t/wth-why-most-settings-are-browser-instance-dependant/468419/16