Skip to content

Commit

Permalink
Initial Commit of Code
Browse files Browse the repository at this point in the history
- Added the basics of the code
- Added various HACS supporting files
- Added read me
  • Loading branch information
amura11 committed Jul 11, 2023
1 parent 4c292ff commit 07ce14b
Show file tree
Hide file tree
Showing 14 changed files with 19,739 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
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
18 changes: 18 additions & 0 deletions .github/workflows/validate.yaml
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"
38 changes: 38 additions & 0 deletions .gitignore
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
25 changes: 25 additions & 0 deletions .vscode/tasks.json
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
}
]
}
}
]
}
68 changes: 68 additions & 0 deletions README.md
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
18,637 changes: 18,637 additions & 0 deletions dist/ha-selector-keypad.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/ha-selector-keypad.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions hacs.json
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"
}
Loading

0 comments on commit 07ce14b

Please sign in to comment.