mirror of
https://github.com/mtan93/homeassistant-addons.git
synced 2026-03-08 05:21:51 +00:00
Change data location from /share to /data; Introduce eval
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## [1.12.0] - 2021-03-06
|
||||
- Introduce new `eval` options
|
||||
- Do no longer store `/data` inside `share` folder
|
||||
|
||||
## [1.11.0] - 2021-02-15
|
||||
- Update `eufy-ha-mqtt-bridge` to `0.2.11` [Changelog](https://github.com/matijse/eufy-ha-mqtt-bridge/releases)
|
||||
|
||||
|
||||
32
eufy-ha-mqtt-bridge/DOCS.md
Normal file
32
eufy-ha-mqtt-bridge/DOCS.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Home Assistant Add-on: Eufy Home Assistant MQTT Bridge
|
||||
|
||||
## Configuration
|
||||
### `eval` (string)
|
||||
Allows to pass some bash commands to run every time before the start of the bridge.
|
||||
|
||||
Multi-line commands are possible but must end with `;`. See examples below.
|
||||
|
||||
You might want to disable this after a run.
|
||||
|
||||
*Only use when you know what you are doing!*
|
||||
|
||||
|
||||
#### Example: Symlink data dir to `shares`
|
||||
```yaml
|
||||
eval: |
|
||||
bashio::log.info "Symlinking data dir";
|
||||
mkdir -p /share/eufy-ha-mqtt-bridge/data;
|
||||
rm -rf /app/data;
|
||||
ln -s /share/eufy-ha-mqtt-bridge/data /app;
|
||||
```
|
||||
|
||||
#### Example: Export payloads to file
|
||||
To help adding more devices it is crucial to provide some information, see https://github.com/matijse/eufy-ha-mqtt-bridge/issues/7.
|
||||
|
||||
```yaml
|
||||
eval: >
|
||||
sqlite3 -csv /app/data/database.sqlite "SELECT "'*'" FROM push_payloads" >
|
||||
/share/export.csv
|
||||
```
|
||||
|
||||
*Note:* Asterisk must be removed from the double quotes.
|
||||
@@ -3,7 +3,7 @@ FROM $BUILD_FROM
|
||||
|
||||
ARG VERSION=0.2.11
|
||||
|
||||
RUN apk add --no-cache nodejs npm make g++
|
||||
RUN apk add --no-cache nodejs npm make g++ sqlite
|
||||
|
||||
# add source and unpack
|
||||
ADD "https://github.com/matijse/eufy-ha-mqtt-bridge/archive/${VERSION}.tar.gz" /src.tar.gz
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
|
||||
<a href="https://www.buymeacoffee.com/MaxWinterstein" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="41" width="174"></a>
|
||||
|
||||
Based on https://github.com/matijse/eufy-ha-mqtt-bridge.
|
||||
|
||||
Application data will be written to `/share/eufy-ha-mqtt-bridge/` so log and other files can be accessed from other addons, e.g. the `Samba share` addon, or view it at the `Visual Studio Code` add-on.
|
||||
|
||||
🚨 This also contains some plaintext configuration file with login credentials, so take care who can access your files! 🚨
|
||||
**Based on https://github.com/matijse/eufy-ha-mqtt-bridge.**
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Eufy Home Assistant MQTT Bridge",
|
||||
"version": "1.11.0",
|
||||
"version": "1.12.0",
|
||||
"slug": "eufy-ha-mqtt-bridge",
|
||||
"image": "maxwinterstein/homeassistant-addon-eufy-ha-mqtt-bridge-{arch}",
|
||||
"description": "Publish events as MQTT messages",
|
||||
@@ -24,7 +24,8 @@
|
||||
"password": "homeassistant",
|
||||
"keepalive": 60
|
||||
},
|
||||
"log_level": "info"
|
||||
"log_level": "info",
|
||||
"eval": ""
|
||||
},
|
||||
"schema": {
|
||||
"eufy": {
|
||||
@@ -36,9 +37,9 @@
|
||||
"username": "str?",
|
||||
"password": "str?",
|
||||
"keepalive": "int?"
|
||||
|
||||
},
|
||||
"log_level": "list(error|warn|info|http|verbose|debug|silly)"
|
||||
"log_level": "list(error|warn|info|http|verbose|debug|silly)",
|
||||
"eval": "str?"
|
||||
},
|
||||
"stage": "experimental",
|
||||
"url": "https://github.com/matijse/eufy-ha-mqtt-bridge/",
|
||||
|
||||
@@ -4,9 +4,11 @@ bashio::log.info "Exporting log level for nodejs: $(bashio::config log_level)"
|
||||
export NODE_CONSOLE_LOG_LEVEL=`bashio::config log_level`
|
||||
|
||||
bashio::log.info "Symlinking data dir"
|
||||
mkdir -p /share/eufy-ha-mqtt-bridge/data
|
||||
rm -rf /app/data
|
||||
ln -s /share/eufy-ha-mqtt-bridge/data /app # symlink data mount from share
|
||||
ln -s /data /app
|
||||
|
||||
bashio::log.info "Running 'eval' commands"
|
||||
eval $(bashio::config eval)
|
||||
|
||||
bashio::log.info "Generating config.yml from options.json"
|
||||
echo '# Generated by homeassistant, do not edit!' > /app/data/config.yml
|
||||
@@ -14,6 +16,5 @@ echo '# Edit configuration only at the Add-on configuration tab!' >> /app/data/c
|
||||
json2yml /data/options.json >> /app/data/config.yml
|
||||
|
||||
bashio::log.info "Image build with version $(cat /version)"
|
||||
|
||||
bashio::log.info "starting original stuff..."
|
||||
npm run start
|
||||
Reference in New Issue
Block a user