From 19b9d95781e886a2e45e15be5f7d96b05223874e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 21 Feb 2020 08:37:21 +0100 Subject: [PATCH] Pretty output homematic (#1121) --- homematic/CHANGELOG.md | 5 +++++ homematic/config.json | 2 +- homematic/data/run.sh | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/homematic/CHANGELOG.md b/homematic/CHANGELOG.md index 2088aa0..da57546 100644 --- a/homematic/CHANGELOG.md +++ b/homematic/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 10.2 + +- Update Bashio to fix the wait function +- Extend the log output + ## 10.1 - Fix issue with SSL diff --git a/homematic/config.json b/homematic/config.json index d0e9597..9b7f8cb 100644 --- a/homematic/config.json +++ b/homematic/config.json @@ -1,6 +1,6 @@ { "name": "HomeMatic CCU", - "version": "10.1", + "version": "10.2", "slug": "homematic", "description": "HomeMatic central based on OCCU", "url": "https://github.com/home-assistant/hassio-addons/tree/master/homematic", diff --git a/homematic/data/run.sh b/homematic/data/run.sh index 3e6afbb..f1cc8d0 100755 --- a/homematic/data/run.sh +++ b/homematic/data/run.sh @@ -31,6 +31,8 @@ init_interface_list "$(bashio::config 'rf_enable')" \ # RF support if bashio::config.true 'rf_enable'; then + bashio::log.info "Setup BidCos-RF" + for rf_device in $(bashio::config 'rf|keys'); do TYPE=$(bashio::config "rf[${rf_device}].type") @@ -70,6 +72,8 @@ fi # Wired support if bashio::config.true 'wired_enable'; then + bashio::log.info "Setup Hm-Wired" + for wired_device in $(bashio::config 'wired|keys'); do SERIAL=$(bashio::config "wired[${wired_device}].serial") KEY=$(bashio::config "wired[${wired_device}].key") @@ -95,6 +99,8 @@ fi # HMIP support if bashio::config.true 'hmip_enable'; then + bashio::log.info "Setup HmIP-RF" + # Restore data if [ -f /data/hmip_address.conf ]; then cp -f /data/hmip_address.conf /etc/config/ @@ -122,7 +128,9 @@ if bashio::config.true 'hmip_enable'; then WAIT_PIDS+=($!) if [ ! -f /data/hmip_address.conf ]; then - sleep 30 + bashio::log.info "Wait for HMIPServer" + + bashio::net.wait_for 9292 cp -f /etc/config/hmip_address.conf /data/ fi else @@ -140,19 +148,22 @@ function stop_homematic() { trap "stop_homematic" SIGTERM SIGHUP # Wait until interfaces are initialized +bashio::log.info "Wait until HomeMatic is setup" bashio::net.wait_for 9292 # Start Regahss +bashio::log.info "Start ReGaHss" "$HM_HOME/bin/ReGaHss" -c -f /etc/config/rega.conf & WAIT_PIDS+=($!) # Start WebInterface +bashio::log.info "Initialize webinterface routing" openssl req -new -x509 -nodes -keyout /etc/config/server.pem -out /etc/config/server.pem -days 3650 -subj "/C=DE/O=HomeMatic/OU=Hass.io/CN=$(hostname)" lighttpd-angel -D -f /opt/hm/etc/lighttpd/lighttpd.conf & WAIT_PIDS+=($!) # Start Ingress -bashio::log.info "Starting Nginx..." +bashio::log.info "Starting Nginx" ingress_entry=$(bashio::addon.ingress_entry) sed -i "s#%%INGRESS_ENTRY%%#${ingress_entry}#g" /etc/nginx/nginx.conf nginx &