domotica/concentratore/run.sh
2026-08-27 12:28:06 +02:00

25 lines
695 B
Bash

#!/usr/bin/with-contenv bashio
# Legge le opzioni impostate dall'interfaccia dell'add-on e avvia il concentratore.
GATEWAY=$(bashio::config 'gateway')
PORTA=$(bashio::config 'gateway_porta')
SLAVES=$(bashio::config 'slaves')
REFRESH=$(bashio::config 'refresh')
TIMEOUT=$(bashio::config 'timeout')
ZITTO=""
if ! bashio::config.true 'log'; then
ZITTO="--zitto"
fi
bashio::log.info "Gateway ${GATEWAY}:${PORTA} - inverter ${SLAVES} - rinfresco ${REFRESH}s"
exec python3 /concentratore.py \
--gateway "${GATEWAY}" \
--gateway-porta "${PORTA}" \
--slaves "${SLAVES}" \
--refresh "${REFRESH}" \
--timeout "${TIMEOUT}" \
--host 0.0.0.0 \
--porta 5020 \
${ZITTO}