Align to MyElectricalData

This commit is contained in:
Alexandre
2022-12-17 20:24:42 +01:00
parent af8b4a1d22
commit ea72d47480
5 changed files with 66 additions and 40 deletions

View File

@@ -1,4 +1,17 @@
## 0.8.11-beta1 (17-12-2022)
- Update to latest version from m4dm4rtig4n/myelectricaldata
- Export 5000 port
## 0.8.10 (13-12-2022)
- Update to latest version from m4dm4rtig4n/myelectricaldata
## 0.8.8 (10-12-2022)
- Update to latest version from m4dm4rtig4n/myelectricaldata
## 0.8.7 (03-12-2022)
- Update to latest version from m4dm4rtig4n/myelectricaldata
## 0.8.8-dev (03-12-2022)
- Update to latest version from m4dm4rtig4n/myelectricaldata
@@ -12,25 +25,10 @@
- Add codenotary sign
- New standardized logic for Dockerfile build and packages installation
## 0.8.2-dev (26-11-2022)
## 0.7.7 (25-11-2021)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt
## 0.8.0-dev (27-04-2022)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt
## 0.7.7 (27-04-2022)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt
## 0.8.0-dev (07-04-2022)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt
- Add codenotary sign
- New standardized logic for Dockerfile build and packages installation
- Always aligned with dev versions
## 0.7.8-dev (23-11-2021)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt

View File

@@ -6,7 +6,7 @@
# '.--'` _'` _ .--.)
# -' '-.-';` `
# ' - _.' ``'--.
# '---` .-'""`
# _.-` ('>.-`"""-.
# /`
#=== Home Assistant Addon ===#
@@ -14,7 +14,7 @@
# 1 Build Image #
#################
ARG BUILD_UPSTREAM="0.8.8-dev"
ARG BUILD_UPSTREAM="0.8.11-beta1"
FROM m4dm4rtig4n/myelectricaldata:latest-dev
@@ -47,7 +47,7 @@ RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates >/dev/null || true \
&& mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "0.8.11-beta1" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d
# Manual apps

View File

@@ -17,6 +17,12 @@
"mqtt_autodiscover": true,
"verbose": true
},
"ports": {
"5000/tcp": 5000
},
"ports_description": {
"5000/tcp": "Portail"
},
"schema": {
"CONFIG_LOCATION": "str",
"TZ": "str?",
@@ -28,5 +34,5 @@
],
"slug": "enedisgateway2mqtt_dev",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "0.8.8-dev"
"version": "0.8.11-beta1"
}

View File

@@ -7,7 +7,7 @@
# Where is the config
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
DATABASESOURCE="$(dirname "${CONFIGSOURCE}")/enedisgateway.db"
DATABASESOURCE="$(dirname "${CONFIGSOURCE}")/cache.db"
# Make sure folder exist
mkdir -p "$(dirname "${CONFIGSOURCE}")"
@@ -19,6 +19,43 @@ if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then
mv /data/config.yaml "$CONFIGSOURCE".bak
fi
############
# DATABASE #
############
# If migration was performed, save file in config folder
if [ -f /data/enedisgateway.db.migrate ]; then
bashio::log.warning "Migration performed, enedisgateway.db.migrate copied in $(dirname "${CONFIGSOURCE}")"
mv /data/enedisgateway.db.migrate "$(dirname "${CONFIGSOURCE}")"
fi
# If migration was performed, save file in config folder
if [ -f /data/cache.db ] && [ ! -f "$DATABASESOURCE" ]; then
if [ -f "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db ]; then mv "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db.bak2; fi
mv /data/cache.db "$(dirname "${CONFIGSOURCE}")"
fi
# If migration was not performed, enable migration
if [ -f "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db ]; then
mv "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db /data
fi
# Check if database is here or create symlink
if [ -f "$DATABASESOURCE" ]; then
# Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $(dirname "${CONFIGSOURCE}")"
else
# Create symlink for addon to create database
touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE"
fi
##########
# CONFIG #
##########
# Check if config file is there, or create one from template
if [ -f "$CONFIGSOURCE" ]; then
# Create symlink if not existing yet
@@ -44,21 +81,6 @@ else
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi
# Remove previous link or file
[ -f /data/enedisgateway.db ] && rm /data/enedisgateway.db
# Check if database is here or create symlink
if [ -f "$DATABASESOURCE" ]; then
# Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
else
# Create symlink for addon to create database
touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE"
fi
##############
# Launch App #
##############

View File

@@ -1,9 +1,9 @@
{
"github_beta": "true",
"last_update": "03-12-2022",
"last_update": "17-12-2022",
"repository": "alexbelgium/hassio-addons",
"slug": "enedisgateway2mqtt_dev",
"source": "dockerhub",
"upstream_repo": "m4dm4rtig4n/myelectricaldata",
"upstream_version": "0.8.8-dev"
"upstream_version": "0.8.11-beta1"
}