Compare commits
No commits in common. "bdd99e93741474016bc12953ad5da07f60c43837" and "e080abb4ddc77ab2d58e59d82ea5e653352b1c32" have entirely different histories.
bdd99e9374
...
e080abb4dd
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
<OUTPUT>.js binary
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 Thomas Lovén
|
Copyright (c) 2020 Thomas Lovén
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
@ -1,4 +1,5 @@
|
|||||||
# {{ cookiecutter.project_name }}
|
<NAME>
|
||||||
|
=================
|
||||||
|
|
||||||
[](https://github.com/custom-components/hacs)
|
[](https://github.com/custom-components/hacs)
|
||||||
|
|
||||||
@ -6,6 +7,14 @@
|
|||||||
|
|
||||||
For installation instructions [see this guide](https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins).
|
For installation instructions [see this guide](https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins).
|
||||||
|
|
||||||
|
Install `<NAME>` as a `module`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
resources:
|
||||||
|
- url: /local/<NAME>.js
|
||||||
|
type: module
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"project_name": "Lovelace Custom Card",
|
|
||||||
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-') ",
|
|
||||||
"project_file": "{{ cookiecutter.project_slug.replace('lovelace-', '') ",
|
|
||||||
"author": "Thomas Lovén"
|
|
||||||
}
|
|
25
package.json
Normal file
25
package.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "<NAME>",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"scripts": {
|
||||||
|
"build": "webpack",
|
||||||
|
"watch": "webpack --watch --mode=development",
|
||||||
|
"update-card-tools": "npm uninstall card-tools && npm install thomasloven/lovelace-card-tools"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "github.com:thomasloven/lovelace-<NAME>"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "Thomas Lovén",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"webpack": "^4.41.2",
|
||||||
|
"webpack-cli": "^3.3.10"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"card-tools": "github:thomasloven/lovelace-card-tools"
|
||||||
|
}
|
||||||
|
}
|
10
webpack.config.js
Normal file
10
webpack.config.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/main.js',
|
||||||
|
mode: 'production',
|
||||||
|
output: {
|
||||||
|
filename: '<NAME>.js',
|
||||||
|
path: path.resolve(__dirname)
|
||||||
|
}
|
||||||
|
};
|
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "{{ cookiecutter.project_slug }} Dev",
|
|
||||||
"image": "thomasloven/hass-custom-devcontainer",
|
|
||||||
"postCreateCommand": "sudo -E container setup-dev && npm add",
|
|
||||||
"containerEnv": {
|
|
||||||
"DEVCONTAINER": "1"
|
|
||||||
},
|
|
||||||
"forwardPorts": [8123],
|
|
||||||
"mounts": [
|
|
||||||
"source=${localWorkspaceFolder},target=/config/www/workspace,type=bind",
|
|
||||||
"source=${localWorkspaceFolder}/test,target=/config/test,type=bind",
|
|
||||||
"source=${localWorkspaceFolder}/test/configuration.yaml,target=/config/configuration.yaml,type=bind",
|
|
||||||
"source=${localWorkspaceFolder}/custom_components,target=/config/custom_components,type=bind"
|
|
||||||
],
|
|
||||||
"runArgs": ["--env-file", "${localWorkspaceFolder}/test/.env"],
|
|
||||||
"extensions": [
|
|
||||||
"github.vscode-pull-request-github",
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"spmeesseman.vscode-taskexplorer"
|
|
||||||
],
|
|
||||||
"settings": {
|
|
||||||
"files.eol": "\n",
|
|
||||||
"editor.tabSize": 2,
|
|
||||||
"editor.formatOnPaste": false,
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"editor.formatOnType": true,
|
|
||||||
"[javascript]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[typescript]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"files.trimTrailingWhitespace": true
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
{{ cookiecutter.project_file }}.js binary
|
|
||||||
package-lock.json.binary
|
|
2
{{ cookiecutter.project_slug }}/.gitignore
vendored
2
{{ cookiecutter.project_slug }}/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
custom_components/
|
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"label": "npm: build",
|
|
||||||
"type": "npm",
|
|
||||||
"script": "build",
|
|
||||||
"problemMatcher": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "npm: watch",
|
|
||||||
"type": "npm",
|
|
||||||
"script": "watch",
|
|
||||||
"problemMatcher": [],
|
|
||||||
"presentation": {
|
|
||||||
"panel": "shared",
|
|
||||||
"group": "test"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Run hass",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "sudo container launch",
|
|
||||||
"problemMatcher": [],
|
|
||||||
"presentation": {
|
|
||||||
"panel": "shared",
|
|
||||||
"group": "test"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "{{ cookiecutter.project_name }}",
|
|
||||||
"render_readme": true
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "{{ cookiecutter.project_name }}",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.1.0",
|
|
||||||
"description": "",
|
|
||||||
"scripts": {
|
|
||||||
"build": "rollup -c",
|
|
||||||
"watch": "rollup -c --watch"
|
|
||||||
},
|
|
||||||
"author": "{{ cookiecutter.author }}",
|
|
||||||
"license": "MIT",
|
|
||||||
"devDependencies": {
|
|
||||||
"@babel/core": "^7.23.6",
|
|
||||||
"@babel/preset-env": "^7.23.6",
|
|
||||||
"@rollup/plugin-babel": "^6.0.4",
|
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
||||||
"rollup": "^2.79.1",
|
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
|
||||||
"rollup-plugin-typescript2": "^0.36.0",
|
|
||||||
"typescript": "^5.3.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"lit": "^3.1.0",
|
|
||||||
"tslib": "^2.6.2"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
||||||
import json from "@rollup/plugin-json";
|
|
||||||
import typescript from "rollup-plugin-typescript2";
|
|
||||||
import { terser } from "rollup-plugin-terser";
|
|
||||||
import { getBabelOutputPlugin } from "@rollup/plugin-babel";
|
|
||||||
|
|
||||||
const dev = process.env.ROLLUP_WATCH;
|
|
||||||
|
|
||||||
export default {
|
|
||||||
input: "src/main.ts",
|
|
||||||
output: {
|
|
||||||
file: "{{ cookiecutter.project_file }}.js",
|
|
||||||
format: "es",
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
nodeResolve(),
|
|
||||||
json(),
|
|
||||||
typescript(),
|
|
||||||
getBabelOutputPlugin({ presets: ["@babel/preset-env"] }),
|
|
||||||
!dev && terser({ format: { comments: false } }),
|
|
||||||
],
|
|
||||||
};
|
|
@ -1,4 +0,0 @@
|
|||||||
HASS_USERNAME=dev
|
|
||||||
HASS_PASSWORD=dev
|
|
||||||
LOVELACE_LOCAL_FILES={{ cookiecutter.project_file }}.js
|
|
||||||
LOVELACE_PLUGINS="thomasloven/lovelace-card-mod"
|
|
@ -1,11 +0,0 @@
|
|||||||
default_config:
|
|
||||||
|
|
||||||
demo:
|
|
||||||
|
|
||||||
lovelace:
|
|
||||||
mode: storage
|
|
||||||
dashboards:
|
|
||||||
lovelace-yaml:
|
|
||||||
mode: yaml
|
|
||||||
title: yaml
|
|
||||||
filename: test/lovelace.yaml
|
|
@ -1,17 +0,0 @@
|
|||||||
version: "3.0"
|
|
||||||
|
|
||||||
services:
|
|
||||||
test:
|
|
||||||
image: thomasloven/hass-custom-devcontainer
|
|
||||||
environment:
|
|
||||||
- HASS_USERNAME
|
|
||||||
- HASS_PASSWORD
|
|
||||||
- LOVELACE_LOCAL_FILES
|
|
||||||
- LOVELACE_PLUGINS
|
|
||||||
volumes:
|
|
||||||
- ./configuration.yaml:/config/configuration.yaml:ro
|
|
||||||
- .:/config/test:ro
|
|
||||||
- ..:/config/www/workspace
|
|
||||||
- ../custom_components,target=/config/custom_components
|
|
||||||
ports:
|
|
||||||
- 8125:8123
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es2017",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"experimentalDecorators": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user