-
-
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.
- Loading branch information
Showing
62 changed files
with
2,249 additions
and
2,368 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,9 @@ | ||
{ | ||
"version": "0.2", | ||
"ignorePaths": [], | ||
"dictionaryDefinitions": [], | ||
"dictionaries": [], | ||
"words": ["hass", "bunx"], | ||
"ignoreWords": [], | ||
"import": [] | ||
} |
File renamed without changes.
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,89 @@ | ||
{ | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"plugins": [ | ||
"import", | ||
"jsonc", | ||
"no-unsanitized", | ||
"sonarjs", | ||
"simple-import-sort", | ||
"sort-keys-fix", | ||
"unicorn", | ||
"prettier" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"project": ["tsconfig.json"] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src/**/*.ts"], | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jsonc/recommended-with-jsonc", | ||
"plugin:sonarjs/recommended", | ||
"plugin:unicorn/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:@cspell/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"unicorn/switch-case-braces": "off", | ||
"unicorn/prefer-module": "off", | ||
"@typescript-eslint/no-magic-numbers": "off", | ||
"unicorn/no-object-as-default-parameter": "off", | ||
"unicorn/no-null": "off", | ||
"unicorn/no-empty-file": "off", | ||
"sonarjs/prefer-single-boolean-return": "off", | ||
"unicorn/no-array-callback-reference": "off", | ||
"unicorn/no-await-expression-member": "off", | ||
"unicorn/no-useless-undefined": "off", | ||
"@typescript-eslint/unbound-method": "error", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"packageDir": "./" | ||
} | ||
], | ||
"sonarjs/prefer-immediate-return": "off", | ||
"no-case-declarations": "off", | ||
"no-async-promise-executor": "off", | ||
"sonarjs/no-duplicate-string": "off", | ||
"unicorn/prefer-node-protocol": "off", | ||
"unicorn/no-array-for-each": "off", | ||
"unicorn/import-style": "off", | ||
"sort-keys-fix/sort-keys-fix": "warn", | ||
"unicorn/prefer-event-target": "off", | ||
"simple-import-sort/imports": "warn", | ||
"simple-import-sort/exports": "warn", | ||
"no-console": ["error"], | ||
"@typescript-eslint/no-unnecessary-type-constraint": "off", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/no-explicit-any": "error" | ||
} | ||
}, | ||
{ | ||
"files": ["*.spec.ts", "*.test.ts"], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
"@typescript-eslint/unbound-method": "off", | ||
"@typescript-eslint/no-magic-numbers": "off", | ||
"sonarjs/no-unused-collection": "warn", | ||
"unicorn/consistent-function-scoping": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["metrics.helper.ts", "*.module.ts"], | ||
"parser": "@typescript-eslint/parser", | ||
"rules": { | ||
"@typescript-eslint/no-magic-numbers": "off" | ||
} | ||
} | ||
] | ||
} |
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 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 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 |
---|---|---|
|
@@ -20,13 +20,13 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
cache: "yarn" | ||
cache: 'yarn' | ||
|
||
- name: Install deps | ||
run: yarn install --frozen-lockfile --immutable | ||
|
||
- name: Tests | ||
run: yarn test:coverage | ||
run: yarn coverage | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
|
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 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 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"jsxSingleQuote": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 100, | ||
"arrowParens": "avoid" | ||
"trailingComma": "all", | ||
"proseWrap": "always" | ||
} |
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 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 |
---|---|---|
@@ -1,84 +1,117 @@ | ||
## Automation Standalone 🏡💻🐳 | ||
# Automation Standalone 🏡💻🐳 | ||
|
||
Welcome to the Digital Alchemy standalone automation repository! | ||
|
||
This repository is designed to work as a locally running development server, as well as providing options for long term deployments. | ||
## Purpose | ||
|
||
- 📚 [Documentation](https://docs.digital-alchemy.app) | ||
This repository is designed to work both locally and deployed as a docker container. The container | ||
will interact with the HomeAssistant websocket to fulfill its automation goals. | ||
|
||
## Community | ||
|
||
- 📚 [Documentation](https://docs.digital-alchemy.app/) | ||
- 🗣️ [Discord](https://discord.gg/JkZ35Gv97Y) | ||
|
||
## 🏗️ Setup | ||
## Setup | ||
|
||
### Prerequisites | ||
|
||
Digital Alchemy targets `node20`, which is the only required system dependency. Recommended workspace tools: | ||
These tools need to be installed on your machine: | ||
|
||
- [Volta](https://volta.sh/) - Autonomously manages Node and Yarn versions | ||
- [Docker desktop](https://www.docker.com/products/docker-desktop/) - For packaging the application | ||
|
||
### Clone | ||
|
||
Clone the repository to your local machine and change directory to thew new repo: | ||
Clone the repository to your local machine: | ||
|
||
```bash | ||
git clone [email protected]/Digital-Alchemy-TS/automation-standalone.git | ||
``` | ||
|
||
### Change directory | ||
|
||
Change directory to the repository root: | ||
|
||
```bash | ||
cd automation-standalone | ||
``` | ||
|
||
### Install Dependencies | ||
### Install | ||
|
||
Install dependencies using Yarn: | ||
|
||
```bash | ||
# (optional) enable yarn for setups without Volta | ||
corepack enable | ||
|
||
# install node_modules | ||
yarn install | ||
yarn | ||
``` | ||
|
||
### Configure | ||
|
||
Create a `.env` file from the `.env.template` example file. <sup>[docs](https://docs.digital-alchemy.app/docs/core/configuration)</sup> | ||
Create a `.env` file from the `.env.dist` example file. | ||
|
||
```bash | ||
cp .env.template .env | ||
cp .env.dist .env | ||
``` | ||
|
||
Then, configure each variable in `.env` so that the application can connect to your HA instance. | ||
|
||
## 🪄 Workspace Usage | ||
## Usage | ||
|
||
### Management | ||
### Sync | ||
|
||
Upgrade the version of `@digital-alchemy` libraries to latest. | ||
Synchronize the latest DA packages and write types based on your HA instance | ||
|
||
```bash | ||
yarn upgrade | ||
yarn sync | ||
``` | ||
|
||
Update the library type definitions based on current Home Assistant state. <sup>[docs](https://docs.digital-alchemy.app/docs/home-automation/type-writer/)</sup> | ||
### Run | ||
|
||
Run your automations locally | ||
|
||
```bash | ||
yarn type-writer | ||
yarn dev | ||
``` | ||
|
||
### Run | ||
## Testing | ||
|
||
Run your automations locally | ||
#### Unit tests and integration tests | ||
|
||
Run all your tests | ||
|
||
```bash | ||
# normal start | ||
yarn start | ||
yarn test | ||
``` | ||
|
||
#### End-to-end tests | ||
|
||
See [./playground](./playground/README.md) folder readme. | ||
|
||
## Publication | ||
|
||
# automatic reload when code changes | ||
yarn start:watch | ||
### Build | ||
|
||
Build the application | ||
|
||
```bash | ||
yarn build | ||
``` | ||
|
||
## 🐳 Deployments | ||
### Publish | ||
|
||
Build and publish your application to a docker registry | ||
|
||
```bash | ||
yarn publish | ||
``` | ||
|
||
### Deploy | ||
|
||
For now, this will be considered a manual step. Basically all you have to do is pull the image that | ||
you've just pushed. | ||
|
||
> See the [extended documentation](https://docs.digital-alchemy.app/docs/home-automation/quickstart/automation-standalone/) for details | ||
> _**Note:** make sure that the same variables from `.env.dist` are passed into the container at | ||
> runtime._ | ||
## 📄 License | ||
|
||
|
Oops, something went wrong.