-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from madmicio/typescript-minimal
Typescript minimal
- Loading branch information
Showing
16 changed files
with
1,872 additions
and
1,106 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 @@ | ||
custom: ["buymeacoffee.com/madmicio"] |
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,27 @@ | ||
name: 'Build' | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Build | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Archive built file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: lg-remote-control | ||
path: dist/lg-remote-control.js |
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,32 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
name: Prepare release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Build the file | ||
run: | | ||
npm install | ||
npm version --git-tag-version=false --commit-hooks=false "${{ github.event.release.tag_name }}" | ||
npm run build | ||
- name: Upload build result to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
|
||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: dist/lg-remote-control.js | ||
asset_name: lg-remote-control.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,4 @@ | ||
/node_modules/ | ||
/.rpt2_cache/ | ||
/dist | ||
.idea |
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,61 @@ | ||
## Overriding key actions | ||
|
||
Example config: | ||
```yaml | ||
type: custom:lg-remote-control | ||
av_receiver_family: anthemav | ||
entity: media_player.lg_webos_smart_tv | ||
is_smart_tv: 'true' | ||
colors: | ||
buttons: red | ||
text: blue | ||
background: blue | ||
projectorentity: '' | ||
mac: '00:11:22:33:44:66' | ||
keys: | ||
LEFT: | ||
service: light.toggle | ||
data: | ||
entity_id: light.tv | ||
VOLUME_UP: | ||
service: light.toggle | ||
data: | ||
entity_id: light.tv | ||
``` | ||
available keys: | ||
- `"1"` | ||
- `"2"` | ||
- `"3"` | ||
- `"4"` | ||
- `"5"` | ||
- `"6"` | ||
- `"7"` | ||
- `"8"` | ||
- `"9"` | ||
- `"0"` | ||
- `"UP"` | ||
- `"LEFT"` | ||
- `"ENTER"` | ||
- `"RIGHT"` | ||
- `"BACK"` | ||
- `"DOWN"` | ||
- `"EXIT"` | ||
- `"RED"` | ||
- `"GREEN"` | ||
- `"YELLOW"` | ||
- `"BLUE"` | ||
- `"HOME"` | ||
- `"CHANNELUP"` | ||
- `"MUTE"` | ||
- `"INFO"` | ||
- `"CHANNELDOWN"` | ||
- `"PLAY"` | ||
- `"PAUSE"` | ||
- `"STOP"` | ||
- `"REWIND"` | ||
- `"RECORD"` | ||
- `"FAST_FOWARD"` | ||
- `"POWER"` | ||
- `"VOLUME_UP"` | ||
- `"VOLUME_DOWN"` |
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
This file was deleted.
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,47 @@ | ||
{ | ||
"name": "lg-remote-card", | ||
"version": "v1.1.3-typescript", | ||
"description": "LG Remote card", | ||
"keywords": [ | ||
"home-assistant", | ||
"homeassistant", | ||
"hass", | ||
"automation", | ||
"lovelace", | ||
"custom-cards" | ||
], | ||
"module": "lg-remote-card.js", | ||
"repository": "[email protected]:madmicio/LG-WebOS-Remote-Control.git", | ||
"author": "Maurizio <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"custom-card-helpers": "^1.9.0", | ||
"home-assistant-js-websocket": "^8.0.1", | ||
"lit": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.15.0", | ||
"@babel/plugin-proposal-class-properties": "^7.14.5", | ||
"@babel/plugin-proposal-decorators": "^7.14.5", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"cross-var": "^1.1.0", | ||
"prettier": "^2.4.1", | ||
"replace-in-file": "^6.3.5", | ||
"rollup": "^2.58.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-serve": "^1.1.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"typescript": "^4.4.3" | ||
}, | ||
"scripts": { | ||
"start": "rollup -c rollup.config.dev.js --watch", | ||
"build": "npm run rollup && npm run add-version", | ||
"add-version": "cross-var replace-in-file \"@LG_REMOTE_CONTROL_CARD_VERSION_PLACEHOLDER@\" \"$npm_package_version\" \"dist/lg-remote-control.js\"", | ||
"rollup": "rollup -c" | ||
} | ||
} |
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,42 @@ | ||
import typescript from "rollup-plugin-typescript2"; | ||
import commonjs from "rollup-plugin-commonjs"; | ||
import nodeResolve from "rollup-plugin-node-resolve"; | ||
import babel from "rollup-plugin-babel"; | ||
import { terser } from "rollup-plugin-terser"; | ||
import serve from "rollup-plugin-serve"; | ||
import json from "@rollup/plugin-json"; | ||
|
||
const dev = process.env.ROLLUP_WATCH; | ||
|
||
const serveopts = { | ||
contentBase: ["./dist"], | ||
host: "0.0.0.0", | ||
port: 5000, | ||
allowCrossOrigin: true, | ||
headers: { | ||
"Access-Control-Allow-Origin": "*", | ||
}, | ||
}; | ||
|
||
const plugins = [ | ||
nodeResolve({}), | ||
commonjs(), | ||
typescript(), | ||
json(), | ||
babel({ | ||
exclude: "node_modules/**", | ||
}), | ||
dev && serve(serveopts), | ||
!dev && terser(), | ||
]; | ||
|
||
export default [ | ||
{ | ||
input: "src/lg-remote-control.ts", | ||
output: { | ||
dir: "dist", | ||
format: "es", | ||
}, | ||
plugins: [...plugins], | ||
}, | ||
]; |
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,3 @@ | ||
export const CARD_VERSION = "v@LG_REMOTE_CONTROL_CARD_VERSION_PLACEHOLDER@"; | ||
export const CARD_TAG_NAME = "lg-remote-control"; | ||
export const EDITOR_CARD_TAG_NAME = "lg-remote-control-editor"; |
Oops, something went wrong.