-
-
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,368 additions
and
2,252 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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 @@ | ||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
tsconfigRootDir: __dirname, | ||
sourceType: "module", | ||
}, | ||
plugins: ["@typescript-eslint", "import", "prettier", "unicorn"], | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:unicorn/recommended", | ||
"plugin:prettier/recommended", | ||
], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: [".eslintrc.js"], | ||
rules: { | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-namespace": "off", | ||
"unicorn/prefer-top-level-await": "off", | ||
"unicorn/import-style": "off", | ||
"unicorn/prefer-module": "off", | ||
"unicorn/no-null": "off", | ||
"unicorn/prevent-abbreviations": "off", | ||
}, | ||
}; |
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
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 coverage | ||
run: yarn test: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 |
---|---|---|
@@ -0,0 +1 @@ | ||
20 |
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 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 100, | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"proseWrap": "always" | ||
"jsxSingleQuote": false, | ||
"printWidth": 100, | ||
"arrowParens": "avoid" | ||
} |
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 @@ | ||
node_modules/ |
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,118 +1,82 @@ | ||
# Automation Standalone 🏡💻🐳 | ||
## Automation Standalone 🏡💻🐳 | ||
|
||
Welcome to the Digital Alchemy standalone automation repository! | ||
|
||
## Purpose | ||
|
||
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 | ||
|
||
These tools need to be installed on your machine: | ||
Digital Alchemy targets `node20`, which is the only required system dependency. Recommended workspace tools: | ||
|
||
- [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: | ||
Clone the repository to your local machine and change directory to thew new repo: | ||
|
||
```bash | ||
git clone [email protected]/Digital-Alchemy-TS/automation-standalone.git | ||
``` | ||
|
||
### Change directory | ||
|
||
Change directory to the repository root: | ||
|
||
```bash | ||
cd automation-standalone | ||
``` | ||
|
||
### Install | ||
### Install Dependencies | ||
|
||
Install dependencies using Yarn: | ||
|
||
```bash | ||
yarn | ||
# (optional) enable yarn for setups without Volta | ||
corepack enable | ||
|
||
# install node_modules | ||
yarn install | ||
``` | ||
|
||
### Configure | ||
|
||
Create a `.env` file from the `.env.dist` example file. | ||
Create a `.env` file from the `.env.template` example file. <sup>[docs](https://docs.digital-alchemy.app/docs/core/configuration)</sup> | ||
|
||
```bash | ||
cp .env.dist .env | ||
cp .env.template .env | ||
``` | ||
|
||
Then, configure each variable in `.env` so that the application can connect to your HA instance. | ||
|
||
## Usage | ||
## 🪄 Workspace Usage | ||
|
||
### Sync | ||
### Management | ||
|
||
Synchronize the latest DA packages and write types based on your HA instance | ||
|
||
```bash | ||
yarn sync | ||
``` | ||
|
||
### Run | ||
|
||
Run your automations locally | ||
Upgrade the version of `@digital-alchemy` libraries to latest. | ||
|
||
```bash | ||
yarn dev | ||
yarn upgrade | ||
``` | ||
|
||
## Testing | ||
|
||
#### Unit tests and integration tests | ||
|
||
Run all your tests | ||
Update the library type definitions based on current Home Assistant state. <sup>[docs](https://docs.digital-alchemy.app/docs/home-automation/type-writer/)</sup> | ||
|
||
```bash | ||
yarn test | ||
yarn type-writer | ||
``` | ||
|
||
#### End-to-end tests | ||
|
||
See [./playground](./playground/README.md) folder readme. | ||
|
||
## Publication | ||
|
||
### Build | ||
### Run | ||
|
||
Build the application | ||
Run your automations locally | ||
|
||
```bash | ||
yarn build | ||
``` | ||
|
||
### Publish | ||
# normal start | ||
yarn start | ||
|
||
Build and publish your application to a docker registry | ||
|
||
```bash | ||
yarn publish | ||
# automatic reload when code changes | ||
yarn start:watch | ||
``` | ||
|
||
### 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. | ||
|
||
> _**Note:** make sure that the same variables from `.env.dist` are passed into the container at | ||
> runtime._ | ||
## 📄 License | ||
|
||
This project is licensed under the MIT License, as detailed in the [LICENSE](./LICENSE) file. |
Oops, something went wrong.