|
1 | 1 | #!/usr/bin/env bash
|
2 | 2 |
|
3 |
| -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
| 3 | +source /opt/container/helpers/common/paths.sh |
| 4 | +mkdir -p /config |
4 | 5 |
|
5 |
| -cd $SCRIPT_DIR/.. |
| 6 | +# Required to get automations to work |
| 7 | +echo "Creatin automations.yaml" |
| 8 | +touch /config/automations.yaml |
| 9 | + |
| 10 | +# source: /opt/container/helpers/commons/homeassistant/start.sh |
| 11 | +if test -d "custom_components"; then |
| 12 | + echo "Symlink the custom component directory" |
6 | 13 |
|
| 14 | + if test -d "custom_components"; then |
| 15 | + rm -R /config/custom_components |
| 16 | + fi |
| 17 | + |
| 18 | + ln -sf "$(workspacePath)custom_components/" /config/custom_components || echo "Could not copy the custom_component" exit 1 |
| 19 | +elif test -f "__init__.py"; then |
| 20 | + echo "Having the component in the root is currently not supported" |
| 21 | +fi |
| 22 | + |
| 23 | +# Install |
| 24 | +echo "Install home assistant" |
7 | 25 | container install
|
8 | 26 |
|
9 |
| -pip install -r $SCRIPT_DIR/../requirements_dev.txt |
| 27 | +echo "Installing Requirements_dev.txt" |
| 28 | +pip install -r $(workspacePath)requirements_dev.txt |
10 | 29 |
|
11 |
| -# Required to get automations to work |
12 |
| -touch /config/automations.yaml |
13 | 30 |
|
14 | 31 | # pre-commit
|
15 |
| -sudo apt update; apt install -y ruby |
| 32 | +echo "Install pre-commit dependencies" |
| 33 | +sudo apt update; apt install -y ruby vim |
16 | 34 |
|
| 35 | +echo "Install Pre-Commit in this repo" |
17 | 36 | pre-commit install
|
| 37 | + |
| 38 | +# Custom Cards & Modules |
| 39 | +echo "Installing NodeJS" |
| 40 | +curl -fsSL https://deb.nodesource.com/setup_16.x | bash - |
| 41 | +apt-get install -y nodejs |
| 42 | + |
| 43 | + |
| 44 | +cd /tmp |
| 45 | +# Install dependency modules |
| 46 | +## Browser mod |
| 47 | +echo "Installing Custom Component: Browser Mod" |
| 48 | +wget https://github.com/thomasloven/hass-browser_mod/archive/refs/tags/1.5.1.tar.gz -O browser_mod.tar.gz |
| 49 | +tar -xvf browser_mod.tar.gz |
| 50 | +rm -rf /config/custom_components/browser_mod |
| 51 | +mv hass-browser_mod*/custom_components/browser_mod /config/custom_components/browser_mod |
| 52 | + |
| 53 | +## virtual |
| 54 | +echo "Installing Custom Component: Virtual" |
| 55 | +wget https://github.com/twrecked/hass-virtual/archive/refs/tags/v0.7.5.tar.gz -O virtual.tar.gz |
| 56 | +tar -xvf virtual.tar.gz |
| 57 | +rm -rf /config/custom_components/virtual |
| 58 | +mv hass-virtual*/custom_components/virtual /config/custom_components/virtual |
0 commit comments