From 0450f9f8ae0a4042e0ace3d97cc7d510b98b9aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Senart?= <> Date: Thu, 16 Jan 2025 20:59:00 +0100 Subject: [PATCH] [#47] 'reset' configuration parameter is ignored in the addon configuration panel. --- .github/workflows/publish-to-dockerhub/action.yaml | 4 ++-- CHANGELOG.md | 6 ++++++ .../rootfs/app/config/configuration.template.yaml | 2 +- addons/gazpar2haws/rootfs/app/run.sh | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-dockerhub/action.yaml b/.github/workflows/publish-to-dockerhub/action.yaml index bc74835..da3dd8d 100644 --- a/.github/workflows/publish-to-dockerhub/action.yaml +++ b/.github/workflows/publish-to-dockerhub/action.yaml @@ -42,10 +42,10 @@ runs: with: images: ${{ inputs.image }} tags: | - # Set latest tag for the default branch - type=raw,value=latest,enable=${{ inputs.is_latest }} # Set the version tag for all branches type=raw,value=${{ inputs.version }} + # Set latest tag for the default branch + type=raw,value=latest,enable=${{ inputs.is_latest }} - name: Log in to Docker Hub uses: docker/login-action@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d9b1fb..d74d7c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.13] - 2025-01-16 + +### Fixed + +[#47](https://github.com/ssenart/gazpar2haws/issues/47): 'reset' configuration parameter is ignored in the addon configuration panel. + ## [0.1.12] - 2025-01-15 ### Fixed diff --git a/addons/gazpar2haws/rootfs/app/config/configuration.template.yaml b/addons/gazpar2haws/rootfs/app/config/configuration.template.yaml index c22f182..1b15944 100644 --- a/addons/gazpar2haws/rootfs/app/config/configuration.template.yaml +++ b/addons/gazpar2haws/rootfs/app/config/configuration.template.yaml @@ -13,7 +13,7 @@ grdf: pce_identifier: "!secret grdf.pce_identifier" timezone: "${GRDF_TIMEZONE}" # Timezone of the data. It should be the same as the Home Assistant timezone. last_days: ${GRDF_LAST_DAYS} # Number of days of data to retrieve - reset: false # If true, the data will be reset before the first data retrieval. If false, the data will be kept and new data will be added. + reset: ${GRDF_RESET} # If true, the data will be reset before the first data retrieval. If false, the data will be kept and new data will be added. homeassistant: host: "!secret homeassistant.host" diff --git a/addons/gazpar2haws/rootfs/app/run.sh b/addons/gazpar2haws/rootfs/app/run.sh index 8aed658..855eb19 100644 --- a/addons/gazpar2haws/rootfs/app/run.sh +++ b/addons/gazpar2haws/rootfs/app/run.sh @@ -6,6 +6,7 @@ GRDF_PCE_IDENTIFIER=$(bashio::config 'grdf.pce_identifier') GRDF_SCAN_INTERVAL=$(bashio::config 'grdf.scan_interval') GRDF_LAST_DAYS=$(bashio::config 'grdf.last_days') GRDF_TIMEZONE=$(bashio::config 'grdf.timezone') +GRDF_RESET=$(bashio::config 'grdf.reset') HOMEASSISTANT_HOST=supervisor HOMEASSISTANT_PORT=80 @@ -18,6 +19,7 @@ HOMEASSISTANT_TOKEN=${SUPERVISOR_TOKEN} : "${GRDF_SCAN_INTERVAL:="480"}" # 8 hours : "${GRDF_LAST_DAYS:="365"}" # 1 year : "${GRDF_TIMEZONE:="Europe/Paris"}" # Default timezone: Europe/Paris +: "${GRDF_RESET:="false"}" # Default reset: false : "${HOMEASSISTANT_HOST:?HOMEASSISTANT_HOST is required and not set.}" : "${HOMEASSISTANT_PORT:="8123"}" # Default Home Assistant port @@ -35,9 +37,10 @@ echo "HOMEASSISTANT_HOST: ${HOMEASSISTANT_HOST}" echo "HOMEASSISTANT_PORT: ${HOMEASSISTANT_PORT}" echo "HOMEASSISTANT_ENDPOINT: ${HOMEASSISTANT_ENDPOINT}" echo "HOMEASSISTANT_TOKEN: ${HOMEASSISTANT_TOKEN}" +echo "GRDF_RESET: ${GRDF_RESET}" # Export environment variables -export GRDF_USERNAME GRDF_PASSWORD GRDF_PCE_IDENTIFIER GRDF_SCAN_INTERVAL GRDF_LAST_DAYS GRDF_TIMEZONE HOMEASSISTANT_HOST HOMEASSISTANT_PORT HOMEASSISTANT_ENDPOINT HOMEASSISTANT_TOKEN +export GRDF_USERNAME GRDF_PASSWORD GRDF_PCE_IDENTIFIER GRDF_SCAN_INTERVAL GRDF_LAST_DAYS GRDF_TIMEZONE GRDF_RESET HOMEASSISTANT_HOST HOMEASSISTANT_PORT HOMEASSISTANT_ENDPOINT HOMEASSISTANT_TOKEN # Instantiate the template config if [ ! -e /app/config/configuration.yaml ]; then