├── .devcontainer └── devcontainer.json ├── .gitattributes ├── .gitignore ├── .vscode └── tasks.json ├── LICENSE.txt ├── README.md ├── auto-entities.js ├── hacs.json ├── package-lock.json ├── package.json ├── rollup.config.mjs ├── src ├── editor │ ├── auto-entities-card-editor.ts │ ├── auto-entities-editor.ts │ ├── auto-entities-filter-editor.ts │ ├── auto-entities-help.ts │ ├── auto-entities-sorting-editor.ts │ └── schema.ts ├── filter.ts ├── helpers.ts ├── helpers │ ├── browser_id.ts │ ├── hass.ts │ ├── selecttree.ts │ └── templates.ts ├── main.ts ├── match.ts ├── process_entity.ts ├── sort.ts └── types.ts ├── test ├── .env ├── configuration.yaml ├── docker-compose.yml ├── lovelace.yaml └── lovelace │ ├── basic.yaml │ ├── cards.yaml │ ├── combined.yaml │ ├── errors.yaml │ ├── matching.yaml │ ├── options.yaml │ ├── pagination.yaml │ ├── sorting.yaml │ ├── template.yaml │ └── unique.yaml └── tsconfig.json /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Card-mod Dev", 3 | "image": "thomasloven/hass-custom-devcontainer", 4 | "postCreateCommand": "sudo -E container setup-dev && npm add", 5 | "containerEnv": { 6 | "DEVCONTAINER": "1", 7 | "ENV_FILE": "/config/test/.env" 8 | }, 9 | "forwardPorts": [8123], 10 | "mounts": [ 11 | "source=${localWorkspaceFolder},target=/config/www/workspace,type=bind", 12 | "source=${localWorkspaceFolder}/test,target=/config/test,type=bind", 13 | "source=${localWorkspaceFolder}/test/configuration.yaml,target=/config/configuration.yaml,type=bind" 14 | ], 15 | "runArgs": ["--env-file", "${localWorkspaceFolder}/test/.env"], 16 | "customizations": { 17 | "vscode": { 18 | "extensions": [ 19 | "github.vscode-pull-request-github", 20 | "esbenp.prettier-vscode", 21 | "spmeesseman.vscode-taskexplorer" 22 | ], 23 | "settings": { 24 | "files.eol": "\n", 25 | "editor.tabSize": 2, 26 | "editor.formatOnPaste": false, 27 | "editor.formatOnSave": true, 28 | "editor.formatOnType": true, 29 | "[javascript]": { 30 | "editor.defaultFormatter": "esbenp.prettier-vscode" 31 | }, 32 | "[typescript]": { 33 | "editor.defaultFormatter": "esbenp.prettier-vscode" 34 | }, 35 | "files.trimTrailingWhitespace": true 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | auto-entities.js binary 2 | package-lock.json binary 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .vscode/settings.json -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "npm: build", 6 | "type": "npm", 7 | "script": "build", 8 | "problemMatcher": [] 9 | }, 10 | { 11 | "label": "npm: watch", 12 | "type": "npm", 13 | "script": "watch", 14 | "problemMatcher": [], 15 | "presentation": { 16 | "panel": "shared", 17 | "group": "test" 18 | } 19 | }, 20 | { 21 | "label": "Run hass", 22 | "type": "shell", 23 | "command": "sudo -E container launch", 24 | "problemMatcher": [], 25 | "presentation": { 26 | "panel": "shared", 27 | "group": "test" 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Thomas Lovén 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # auto-entities 2 | 3 | [![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/hacs/integration) 4 | 5 | Automatically populate lovelace cards with entities matching certain criteria. 6 | 7 | Install Custom Icons through HACS [![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=thomasloven&repository=lovelace-auto-entities) or [see this guide](https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins). 8 | 9 | ## Usage 10 | 11 | ```yaml 12 | type: custom:auto-entities 13 | card: 14 | card_param: 15 | entities: 16 | - 17 | - 18 | filter: 19 | template: