-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added the basics of the code - Added various HACS supporting files - Added read me
- Loading branch information
Showing
14 changed files
with
19,739 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ha-selector-keypad/ha-selector-keypad | ||
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/ha-selector-keypad/ha-selector-keypad/dist/ha-selector-keypad.js | ||
asset_name: ha-selector-keypad.js | ||
tag: ${{ github.ref }} | ||
overwrite: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Validate | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
validate-hacs: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
- name: HACS validation | ||
uses: "hacs/action@main" | ||
with: | ||
category: "plugin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
*.swp | ||
|
||
pids | ||
logs | ||
results | ||
tmp | ||
|
||
# Build | ||
public/css/main.css | ||
|
||
# Coverage reports | ||
coverage | ||
|
||
# API keys and secrets | ||
.env | ||
|
||
# Dependency directory | ||
node_modules | ||
bower_components | ||
|
||
# Editors | ||
.idea | ||
*.iml | ||
|
||
# OS metadata | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# ignore yarn.lock | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "build", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"label": "npm: build", | ||
"detail": "rollup -c", | ||
"problemMatcher": { | ||
"pattern": [ | ||
{ | ||
"regexp": ".", | ||
"file": 1, | ||
"location": 2, | ||
"message": 3 | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Home Assistant Keypad | ||
|
||
[![hacs][hacsbadge]][hacs] | ||
[![HACS Validation][validation-shield]](validation) | ||
|
||
[![GitHub Release][releases-shield]][releases] | ||
[![License][license-shield]](LICENSE) | ||
|
||
A simple keypad [selector](https://www.home-assistant.io/docs/blueprint/selectors/) for Home Assistant. Allows you to add a keypad for text input. Primarily built for use with [Browser Mod](https://github.com/thomasloven/hass-browser_mod) when using [form content](https://github.com/thomasloven/hass-browser_mod/blob/master/documentation/popups.md#form-content) but can be used anywhere a selector can. | ||
|
||
## Basic Example | ||
``` | ||
service: browser_mod.popup | ||
data: | ||
title: Enter Value | ||
content: | ||
- name: my_keypad | ||
label: Enter a Value | ||
selector: | ||
keypad: | ||
mask: '*' | ||
``` | ||
|
||
## Installation | ||
### Manually | ||
1. Copy the files from the `dist` directory to the `<config>/www/` | ||
1. Add the following to the `configuration.yaml` file: | ||
``` | ||
lovelace: | ||
resources: | ||
- url: /local/ha-selector-keypad.js?v=1 | ||
type: module | ||
``` | ||
|
||
Note: You can place the files into a sub directory under `<config>/www/<sub-directory>`. If you choose this option ensure the path in the `configuration.yaml` file reflects this. Eg.: | ||
``` | ||
lovelace: | ||
resources: | ||
- url: /local/<sub-directory>/ha-selector-keypad.js?v=1 | ||
type: module | ||
``` | ||
|
||
### Via HACS | ||
1. Add the repository to HACS | ||
1. Add the following to the `configuration.yaml` file: | ||
``` | ||
lovelace: | ||
resources: | ||
- url: /hacsfiles/ha-selector-keypad.js | ||
type: module | ||
``` | ||
|
||
## Configuration Options | ||
|
||
Name | Type | Description | Default | ||
-- | -- | -- | -- | ||
`columns` | number | The maximum number of keys a row can have. | 3 | ||
`mask` | string | A character or string to mask the code value when it's displayed. If `null` the raw code value is displayed. This only changes the display of the code not it's internal value. | `null` | | ||
`show_code` | boolean | A flag to render the code section or not | `true` | ||
`show_label`| boolean | A flag to render the label section or not | `true` | ||
|
||
[releases-shield]: https://img.shields.io/github/release/amura11/ha-selector-keypad.svg?style=for-the-badge | ||
[releases]: https://github.com/amura11/ha-selector-keypad/releases | ||
[hacs]: https://github.com/hacs/integration | ||
[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge | ||
[validation-shield]: https://img.shields.io/github/actions/workflow/status/amura11/ha-selector-keypad/validate.yml?style=for-the-badge&label=HACS%20Validation | ||
[validation]: https://github.com/amura11/ha-selector-keypad/actions/workflows/validate.yml | ||
[license-shield]: https://img.shields.io/github/license/amura11/ha-selector-keypad.svg?style=for-the-badge |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Custom Keypad Selector", | ||
"render_readme": true, | ||
"filename": "ha-selector-keypad.js" | ||
} |
Oops, something went wrong.