Compare commits

..
10 Commits
Author SHA1 Message Date
Colin Seymour f48e92dc71 Remove default Postgres configuration and add-on suggestion (#25)
Don't default to old Postgres
2024-07-18 18:05:13 +01:00
Colin Seymour 306653220b Fix renovate configuration error (#24)
Remove extra comma
2024-07-18 17:41:36 +01:00
renovate[bot]andColin Seymour 2c729d4f75 Update TeslaMate to v1.30.1 (#17)
* Update TeslaMate to v1.30.1

* Update Dockerfile

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Colin Seymour <colin@symr.io>
2024-07-18 16:26:07 +01:00
renovate[bot] 89abf45735 Update softprops/action-gh-release action to v2.0.7 (#20)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-18 16:25:05 +01:00
renovate[bot] 3c1545d9e4 Update actions/checkout action to v4.1.7 (#14)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-18 16:21:45 +01:00
Colin Seymour 64f0213e30 Fix database check and creation (#23)
* Refactor db check and create

* Make exit more accurate
2024-07-18 16:20:36 +01:00
Colin Seymour 213a2205fc Clearly differentiate add-on changes (#16) 2024-06-16 08:18:20 +01:00
Colin Seymour a9c53f4cd5 Update Renovate configuration and fix inclusion of TeslaMate release notes in add-on changelog (#13)
* Fix renovate config

* Fix including TeslaMate release notes
2024-06-12 14:57:17 +01:00
Colin Seymour b964d2dbc9 Limit Renovate managers (#12)
Limit managers
2024-06-11 14:40:50 +01:00
Colin Seymour 4ab0062498 Renovate and releaser improvements (#11)
* Update all files from release

* Pull in TeslaMate release notes
2024-06-11 11:36:45 +01:00
13 changed files with 54 additions and 36 deletions
+2 -1
View File
@@ -8,10 +8,11 @@
"prBodyTemplate": "{{{table}}}{{{warnings}}}{{{notes}}}{{{changelogs}}}",
"semanticCommits": "disabled",
"commitMessageTopic": "{{#if (containsString depName 'teslamate')}}TeslaMate{{else}}{{depName}}{{/if}}",
"enabledManagers": ["custom.regex", "github-actions", "dockerfile"],
"customManagers": [
{
"customType": "regex",
"fileMatch": "^build\\.json$",
"fileMatch": "^build.json$",
"matchStrings": [
"\"teslamate_version\": \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\""
],
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4.1.7
- name: 🚀 Run Home Assistant Add-on Lint
uses: frenck/action-addon-linter@v2
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4.1.7
- name: Get version
run: |
+14 -2
View File
@@ -32,6 +32,17 @@ jobs:
with:
semver-input: ${{ env.latest_release }}
increment: ${{ github.event.inputs.semverIncrement }}
- name: Get TeslaMate release notes
run: |
touch CHANGELOG.txt
gh pr list --repo lildude/ha-addon-teslamate --state=merged --search="Update TeslaMate" --limit=1 --json=body --jq '.[].body' | sed -n "/<\/summary>/,/<\/details>/p" | sed '1d;$d' > changelog.tmp
if [ -s changelog.tmp ]; then
echo "## TeslaMate Release Notes" > CHANGELOG.txt
cat changelog.tmp >> CHANGELOG.txt
echo -e "---\n\n## Add-on Release Notes\n\n" >> CHANGELOG.txt
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag
run: |
git config --global user.email "actions.no-reply@github.com"
@@ -40,15 +51,16 @@ jobs:
git push --tags
working-directory: ${{ github.workspace }}/teslamate
- name: Create release
uses: softprops/action-gh-release@v2.0.5
uses: softprops/action-gh-release@v2.0.7
with:
tag_name: v${{ steps.semver.outputs.semver }}
body_path: CHANGELOG.txt
generate_release_notes: true
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout addon repo
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4.1.7
with:
path: repo
repository: lildude/ha-addons
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4.1.7
- name: Build add-on
uses: home-assistant/builder@master
+1 -2
View File
@@ -29,7 +29,7 @@ Remember to restart the add-on when the configuration is changed.
- `database_port`: The port your PostgreSQL server is listening on. Default: `5432`.
- `database_host`: The hostname of your PostgreSQL server. Default: `29b65938-postgres` for the [PostgreSQL add-on][postgres].
- `database_host`: The hostname of your PostgreSQL server.
- `database_name`: The name of the PostgreSQL database. Default: `teslamate`.
@@ -137,7 +137,6 @@ Follow this process:
[grafana-addon]: https://github.com/hassio-addons/addon-grafana
[grafana-datasource]: https://raw.githubusercontent.com/lildude/hassio-addon-teslamate/main/imgs/grafana-postgres.png
[mosquitto-docs]: https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md
[postgres]: https://github.com/matt-FFFFFF/hassio-addon-postgres
[samba-addon]: https://github.com/home-assistant/addons/blob/master/samba/DOCS.md
[ssh-addon]: https://github.com/home-assistant/addons/blob/master/ssh/DOCS.md
[teslafi-import]: https://docs.teslamate.org/docs/import/teslafi
+2 -2
View File
@@ -1,8 +1,8 @@
FROM teslamate/grafana:1.29.1 as grafana
FROM teslamate/grafana:1.30.1 as grafana
#---
FROM teslamate/teslamate:1.29.1
FROM teslamate/teslamate:1.30.1
ARG BUILD_ARCH
ARG BASHIO_VERSION=0.16.2
+2 -4
View File
@@ -25,9 +25,7 @@ Thanks to @matt-FFFFFF for maintaining this add-on in the past.
## Requirements
TeslaMate needs a PostgreSQL database.
All development and testing has been done using [PostgreSQL add-on][postgres] for convenience but you're welcome to use your own.
For convenience, my [add-ons repository][addons-repo] includes configuration that points to the [PostgreSQL add-on][postgres] so you can install everything from one repo.
I recommend using the [PostgreSQL add-on][alexbelgium-postgres] from @alexbelgium's repository if you aren't already using Postgres.
To get the full experience, it is recommended that you also install the community [Grafana add-on][grafana-addon] and [MQTT integration][mqtt].
@@ -69,13 +67,13 @@ Everything should pick up where it was before.
[addon]: https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Flildude%2Fha-addons
[addons-repo]: https://github.com/lildude/ha-addons
[alexbegium-postgres]: https://github.com/alexbelgium/hassio-addons/tree/master/postgres
[archs]: https://img.shields.io/badge/dynamic/json?color=green&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-teslamate%2Fmain%2Fconfig.json
[docker]: https://hub.docker.com/r/teslamate/teslamate
[elixir]: https://elixir-lang.org/
[grafana-addon]: https://github.com/hassio-addons/addon-grafana
[ingres-badge]: https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-teslamate%2Fmain%2Fconfig.json
[mqtt]: https://www.home-assistant.io/integrations/mqtt
[postgres]: https://github.com/matt-FFFFFF/hassio-addon-postgres
[repo-btn]: https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg
[sponsor-badge]: https://img.shields.io/badge/Sponsor_Me-%E2%9D%A4-ec6cb9?logo=GitHub
[teslamate-backup]: https://docs.teslamate.org/docs/maintenance/backup_restore
+1 -1
View File
@@ -5,7 +5,7 @@
"armv7": "teslamate/teslamate:not-used"
},
"args": {
"teslamate_version": "1.29.1"
"teslamate_version": "1.30.1"
},
"codenotary": {
"signer": "colin@symr.io"
+1 -1
View File
@@ -17,7 +17,7 @@
"database_user": null,
"database_pass": null,
"database_name": "teslamate",
"database_host": "29b65938-postgres",
"database_host": null,
"database_port": 5432,
"database_ssl": false,
"grafana_import_dashboards": true,
+8 -3
View File
@@ -2,8 +2,13 @@
# -*- bash -*-
# shellcheck shell=bash
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "Nginx crashed, halting add-on"
case "${1}" in
1)
bashio::log.error "Nginx encountered an error, halting add-on"
;;
*)
bashio::log.error "Nginx crashed, halting add-on"
;;
esac
/run/s6/basedir/bin/halt
fi
bashio::log.info "Nginx stopped, restarting..."
+8 -2
View File
@@ -2,8 +2,14 @@
# -*- bash -*-
# shellcheck shell=bash
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "TeslaMate crashed, halting add-on"
case "${1}" in
1)
bashio::log.error "TeslaMate encountered an error, halting add-on"
;;
*)
bashio::log.error "TeslaMate crashed, halting add-on"
;;
esac
/run/s6/basedir/bin/halt
fi
bashio::log.info "TeslaMate stopped, restarting..."
+11 -14
View File
@@ -51,23 +51,20 @@ fi
# Create the PostgreSQL database if it doesn't exist
if pg_isready -h "$DATABASE_HOST" -p "$DATABASE_PORT" > /dev/null 2>&1; then
bashio::log.info "Creating database $DATABASE_NAME on $DATABASE_HOST"
bashio::log.info "Creating database '$DATABASE_NAME' on $DATABASE_HOST"
res=$(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -c "CREATE DATABASE $DATABASE_NAME" 2>&1) || true
case "$res" in
"CREATE DATABASE")
bashio::log.info "Database $DATABASE_NAME created"
;;
*"already exists"*)
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list $DATABASE_NAME") ]]; then
bashio::log.info "Database $DATABASE_NAME already exists"
;;
*)
bashio::log.error "Failed to create database $DATABASE_NAME: $res"
exit 1
;;
esac
else
bashio::log.error "PostgreSQL is not ready"
if PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -qc "CREATE DATABASE \"$DATABASE_NAME\""; then
bashio::log.info "Database $DATABASE_NAME created"
else
bashio::log.error "Failed to create database $DATABASE_NAME"
exit 1
fi
fi
else
bashio::log.error "PostgreSQL at '$DATABASE_HOST' is not ready or unreachable"
exit 1
fi