Skip to content

Commit

Permalink
add readme, git workflows, hacs support
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-panteleev committed Jan 19, 2022
1 parent 0d5ed95 commit fc02ffe
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Build'

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build
run: |
npm install
npm run build
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
release:
types: [published]

jobs:
release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

# Build
- name: Build the file
run: |
cd /home/runner/work/lovelace-qr-code-card/lovelace-qr-code-card
npm install
npm run build
# Upload build file to the release as an asset.
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release

with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/lovelace-qr-code-card/lovelace-qr-code-card/dist/qr-code-card.js
asset_name: qr-code-card.js
tag: ${{ github.ref }}
overwrite: true
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[![hacs_badge][hacs_shield]][hacs]
[![GitHub Latest Release][releases_shield]][latest_release]

[hacs_shield]: https://img.shields.io/badge/HACS-Custom-41BDF5.svg?style=for-the-badge
[hacs]: https://github.com/hacs/integration

[releases_shield]: https://img.shields.io/github/release/igor-panteleev/lovelace-qr-code-card.svg?style=for-the-badge
[latest_release]: https://github.com/igor-panteleev/lovelace-qr-code-card/releases/latest

# Lovelace QRCode Generator card
This card provides a possibility to generate QRCode in Home Assistant interface.

## Installation
### TODO: add installation instructions

## Configuration

<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Required</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td><code>source</code></td>
<td>string</td>
<td>yes</td>
<td><i>text</i></td>
<td>Card source type. Options: <code>text</code>, <code>entity</code>, <code>wifi</code></td>
</tr>
<tr>
<td colspan="5" style="text-align: center">
Text mode options
</td>
</tr>
<tr>
<td><code>text</code></td>
<td>string</td>
<td>yes</td>
<td><i>QRCode example text</i></td>
<td>Text that will be used for QRCode generation</td>
</tr>
<tr>
<td colspan="5" style="text-align: center">
Entity mode options
</td>
</tr>
<tr>
<td><code>entity</code></td>
<td>string</td>
<td>yes</td>
<td>empty</td>
<td>Entity that will be used for QRCode generation</td>
</tr>
<tr>
<td colspan="5" style="text-align: center">
Wi-Fi mode options
</td>
</tr>
<tr>
<td><code>auth_type</code></td>
<td>string</td>
<td>yes</td>
<td>empty</td>
<td>Wi-Fi network authentication type. Options: <code>WEP</code>, <code>WPA</code>, <code>nopass</code></td>
</tr>
<tr>
<td><code>ssid</code></td>
<td>string</td>
<td>yes</td>
<td>empty</td>
<td>Wi-Fi network ssid</td>
</tr>
<tr>
<td><code>password</code></td>
<td>string</td>
<td>yes (except <code>nopass</code> authentication)</td>
<td>empty</td>
<td>Wi-Fi network password</td>
</tr>
<tr>
<td><code>is_hidden</code></td>
<td>boolean</td>
<td>no</td>
<td>empty</td>
<td>Is Wi-Fi network is hidden</td>
</tr>
</table>
5 changes: 5 additions & 0 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "QR code generator card",
"render_readme": true,
"filename": "qr-code-card.js"
}
2 changes: 1 addition & 1 deletion src/localize/languages/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"common": {
"description": "Simple QR code card.",
"description": "QR code generator card",
"invalid_configuration": "Invalid configuration",
"loading": "Loading..."
},
Expand Down
2 changes: 1 addition & 1 deletion src/qr-code-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class QRCodeCard extends LitElement {
return {
type: "custom:" + CARD_CUSTOM_ELEMENT_NAME,
source: SourceType.TEXT,
text: localize("common.description")
text: "QRCode example text"
};
}

Expand Down

0 comments on commit fc02ffe

Please sign in to comment.