mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-24 10:33:59 +02:00
Compare commits
6 Commits
891e0eec9d
...
be5e76e219
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be5e76e219 | ||
|
|
560a74ea0e | ||
|
|
ec058113c7 | ||
|
|
4c250651b0 | ||
|
|
f4e9080832 | ||
|
|
d8eb2dfaca |
@@ -1,3 +1,5 @@
|
||||
## 2025.11.06 (15-11-2025)
|
||||
- Minor bugs fixed
|
||||
## 2025.11.05 (15-11-2025)
|
||||
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
|
||||
|
||||
|
||||
@@ -116,5 +116,5 @@ tmpfs: true
|
||||
udev: true
|
||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi
|
||||
usb: true
|
||||
version: 2025.11.05
|
||||
version: 2025.11.06
|
||||
video: true
|
||||
|
||||
@@ -112,15 +112,17 @@ def automatic_mqtt_publish(file, detection, path):
|
||||
mqttc.publish(mqtt_topic, json_bird, 1)
|
||||
log.info("Posted to MQTT: ok")
|
||||
|
||||
|
||||
# Create MQTT client using legacy callback API when available for
|
||||
# compatibility with paho-mqtt >= 2.0
|
||||
callback_api = getattr(mqtt, "CallbackAPIVersion", None)
|
||||
|
||||
if callback_api is not None:
|
||||
mqttc = mqtt.Client("birdnet_mqtt", callback_api_version=callback_api.VERSION1)
|
||||
# paho-mqtt >= 2.0: first argument is callback_api_version
|
||||
mqttc = mqtt.Client(callback_api.VERSION1, client_id="birdnet_mqtt")
|
||||
else:
|
||||
mqttc = mqtt.Client("birdnet_mqtt")
|
||||
# paho-mqtt < 2.0: old signature, first argument is client_id
|
||||
mqttc = mqtt.Client(client_id="birdnet_mqtt")
|
||||
|
||||
mqttc.username_pw_set(mqtt_user, mqtt_pass)
|
||||
mqttc.on_connect = on_connect
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
## v5.0_beta5-4 (15-11-2025)
|
||||
- Increment version for rebuilt add-on
|
||||
## v5.0_beta5-3 (15-11-2025)
|
||||
- Minor bugs fixed
|
||||
## v5.0_beta6 (06-01-2025)
|
||||
|
||||
@@ -107,5 +107,5 @@ services:
|
||||
- mysql:want
|
||||
slug: monica
|
||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/monica
|
||||
version: v5.0_beta5-3
|
||||
version: v5.0_beta5-4
|
||||
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"
|
||||
|
||||
@@ -152,6 +152,52 @@ if [[ "${MEILISEARCH_LOCAL}" == true ]]; then
|
||||
S6_SUPERVISED_DIR="/var/run/s6/services"
|
||||
fi
|
||||
|
||||
S6_SVSCANCTL_BIN="$(command -v s6-svscanctl || true)"
|
||||
if [ -z "${S6_SVSCANCTL_BIN}" ] && [ -x /command/s6-svscanctl ]; then
|
||||
S6_SVSCANCTL_BIN="/command/s6-svscanctl"
|
||||
fi
|
||||
|
||||
meilisearch_fail() {
|
||||
local message="$1"
|
||||
local exit_code="${2:-1}"
|
||||
|
||||
bashio::log.error "${message}"
|
||||
|
||||
if [ -n "${S6_SVSCANCTL_BIN}" ]; then
|
||||
if ! "${S6_SVSCANCTL_BIN}" -t "${S6_SUPERVISED_DIR}" 2>/dev/null; then
|
||||
bashio::log.error "Unable to signal s6-svscanctl to stop services"
|
||||
fi
|
||||
else
|
||||
bashio::log.error "s6-svscanctl binary not found; unable to stop services gracefully"
|
||||
fi
|
||||
|
||||
if [ "${exit_code}" -eq 0 ]; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
exit "${exit_code}"
|
||||
}
|
||||
|
||||
meilisearch_ensure_running() {
|
||||
if kill -0 "${MEILISEARCH_PID}" 2>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local exit_code=0
|
||||
|
||||
set +e
|
||||
wait "${MEILISEARCH_PID}"
|
||||
exit_code=$?
|
||||
set -e
|
||||
|
||||
local wait_code="${exit_code}"
|
||||
if [ "${exit_code}" -eq 0 ]; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
meilisearch_fail "Meilisearch exited unexpectedly (code ${wait_code}). Stopping add-on." "${exit_code}"
|
||||
}
|
||||
|
||||
MEILISEARCH_CMD=(
|
||||
env \
|
||||
MEILI_ENV="${MEILISEARCH_ENVIRONMENT}" \
|
||||
@@ -168,19 +214,20 @@ if [[ "${MEILISEARCH_LOCAL}" == true ]]; then
|
||||
"${MEILISEARCH_CMD[@]}" &
|
||||
MEILISEARCH_PID=$!
|
||||
|
||||
(
|
||||
set +e
|
||||
wait "${MEILISEARCH_PID}"
|
||||
exit_code=$?
|
||||
set -e
|
||||
if [ "${exit_code}" -ne 0 ]; then
|
||||
bashio::log.error "Meilisearch exited unexpectedly (code ${exit_code}). Stopping add-on."
|
||||
s6-svscanctl -t "${S6_SUPERVISED_DIR}"
|
||||
fi
|
||||
) &
|
||||
|
||||
bashio::log.info "Waiting for Meilisearch TCP socket"
|
||||
bashio::net.wait_for "${MEILISEARCH_ADDR%:*}" "${MEILISEARCH_ADDR#*:}"
|
||||
for attempt in $(seq 1 30); do
|
||||
if bash -c "cat < /dev/null > /dev/tcp/${MEILISEARCH_HOST}/${MEILISEARCH_PORT}" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
|
||||
meilisearch_ensure_running
|
||||
|
||||
if [ "${attempt}" -eq 30 ]; then
|
||||
meilisearch_fail "Meilisearch TCP socket did not become ready in time. Stopping add-on."
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
bashio::log.info "Waiting for Meilisearch health endpoint"
|
||||
MEILISEARCH_HEALTH_URL="${MEILISEARCH_URL%/}/health"
|
||||
@@ -189,12 +236,13 @@ if [[ "${MEILISEARCH_LOCAL}" == true ]]; then
|
||||
bashio::log.info "Meilisearch is ready"
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
meilisearch_ensure_running
|
||||
|
||||
if [ "${attempt}" -eq 30 ]; then
|
||||
bashio::log.error "Meilisearch did not become ready in time. Stopping add-on."
|
||||
s6-svscanctl -t "${S6_SUPERVISED_DIR}"
|
||||
exit 1
|
||||
meilisearch_fail "Meilisearch did not become ready in time. Stopping add-on."
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
else
|
||||
bashio::log.info "Detected external Meilisearch endpoint (${MEILISEARCH_URL}); skipping bundled service startup"
|
||||
|
||||
Reference in New Issue
Block a user