Files
addons/homematic/rootfs/etc/cont-init.d/hm_ip.sh
Jens Maus 37aeb25706 final fixes for homematic addon (#2360)
* added missing gnu.io.rxtx.SerialPorts java option to get hmipserver running with raw-uart device.

* use openjdk-8-jre-headless because hmipserver is compatibly to max. java-8 only.

* disabled hmip rf-firmware update to prevent accidently performed firmware downgrade (not required anymore for obsolete addon anyway)

* version bump.

* fixed shellcheck errors.

* use openjdk-11-jre-headless again since bullseye does not have java-8
package anymore.
2022-01-26 09:30:28 +01:00

48 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/with-contenv bashio
# ==============================================================================
# Update HomeMatic firmware
# ==============================================================================
# shellcheck disable=SC2012
#declare hmip_index
#declare hmip_device
#declare version_to
#declare version_from
# HMIP support
if bashio::config.false 'hmip_enable'; then
bashio::exit.ok
fi
bashio::log.info "Setup HmIP-RF"
# Generate config
tempio \
-conf /data/options.json \
-template /usr/share/tempio/crRFD.conf \
-out /etc/config/crRFD.conf
# Restore data
if [ -f /data/hmip_address.conf ]; then
cp -f /data/hmip_address.conf /etc/config/
fi
# Update Firmware
#for hmip_index in $(bashio::config 'hmip|keys'); do
# hmip_device=$(bashio::config "hmip[${hmip_index}].device")
#
# # Skeep device path with id
# if echo "${hmip_device}" | grep "by-id"; then
# bashio::log.warning "Skip firmware for ${hmip_device}"
# continue
# fi
#
# version_from="$(java -Xmx64m -jar /opt/HmIP/hmip-copro-update.jar -p "${hmip_device}" -v | grep "Application version =" | cut -d' ' -f5)"
# version_to="$(ls /firmware/HmIP-RFUSB/hmip_coprocessor_update-*.eq3 | sed 's/.*hmip_coprocessor_update-\(.*\)\.eq3/\1/' | tail -n1)"
# if [ "${version_from}" != "${version_to}" ]; then
# if java -Xmx64m -jar /opt/HmIP/hmip-copro-update.jar -p "${hmip_device}" -f "/firmware/HmIP-RFUSB/hmip_coprocessor_update-${version_to}.eq3"; then
# bashio::log.info "HmIP update to ${version_to} was successful"
# else
# bashio::log.error "HmIP update ${version_to} fails!"
# fi
# fi
#done