needed_packages() {
# Install apt-transport-https - update packages through https repository
# Install bc + sysstat - needed for FireMotD
# Install avahi-daemon - hostname based discovery on local networks
# Install python/python3-pip - for python packages
echo -n "$(timestamp) [openHABian] Installing additional needed packages... "
if cond_redirect apt-get -y install apt-transport-https bc sysstat avahi-daemon python3 python3-pip avahi-autoipd fontconfig; then echo "OK"; else echo "FAILED"; exit 1; fi
if is_pithree || is_pithreeplus || is_pizerow || is_pifour; then
echo -n "$(timestamp) [openHABian] Installing additional bluetooth packages... "
local BTPKGS
BTPKGS="bluez python3-dev libbluetooth-dev raspberrypi-sys-mods pi-bluetooth"
# phython3-bluez not available in stretch, but in newer distros
if ! is_stretch; then
BTPKGS="$BTPKGS python3-bluez"
fi
# shellcheck disable=SC2086
if cond_redirect apt-get -y install $BTPKGS; then echo "OK"; else echo "FAILED"; exit 1; fi
fi
}
In case you are not on a stretch release python3-bluez shall be installed. You might run into the error in case the release does not provide python3-bluez.