Skip to content

Commit

Permalink
ccu-addon: do not overwrite existing configuration file on update, fixes
Browse files Browse the repository at this point in the history
 #29

added interface type to device properties, fixes #27
  • Loading branch information
Mathias authored and mdzio committed Jan 7, 2021
1 parent 36a52a6 commit 1f94b2f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build/main.go
Expand Up @@ -12,7 +12,7 @@ import (
const (
logLevel = logging.InfoLevel
appName = "ccu-jack"
appVersion = "0.10.2"
appVersion = "0.10.7"
appPkg = "github.com/mdzio/ccu-jack"
ldFlags = "-s -w -X main.appVersion=" + appVersion
buildDir = ".."
Expand Down Expand Up @@ -60,7 +60,7 @@ var (
{Inc: "dist/ccu/update_script", Exe: true},
{Inc: "README.md", DstDir: "addon"},
{Inc: "LICENSE.txt", DstDir: "addon"},
{Inc: "dist/ccu/addon/ccu-jack.cfg", DstDir: "addon"},
{Inc: "dist/ccu/addon/ccu-jack-default.cfg", DstDir: "addon"},
{Inc: "build/tmp/VERSION", DstDir: "addon"},
{Inc: "dist/ccu/addon/update_hm_addons.tcl", DstDir: "addon", Exe: true},
{Inc: "third-party-licenses/*", DstDir: "addon/third-party-licenses"},
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions dist/ccu/rc.d/ccu-jack
Expand Up @@ -3,7 +3,7 @@
# add-on information
ADDON_ID=ccu-jack
ADDON_NAME="CCU-Jack"
ADDON_COPYRIGHT="(c) 2019-2020 info@ccu-historian.de"
ADDON_COPYRIGHT="(c) 2019-2021 info@ccu-historian.de"
ADDON_WWW='<a href="https://github.com/mdzio/ccu-jack" target="_blank">https://github.com/mdzio/ccu-jack</a>'

# directories
Expand All @@ -21,7 +21,7 @@ stop() {

start() {
logger -t ${ADDON_ID} -p user.debug "Starting"
# wait for ReGaHss startup
# wait for ReGaHss startup/delay restart
sleep 15
# start process
cd ${ADDON_DIR}
Expand Down Expand Up @@ -73,7 +73,6 @@ case "$1" in
;;
restart|reload)
stop
sleep 1
start
;;
uninstall)
Expand Down
6 changes: 6 additions & 0 deletions dist/ccu/update_script
Expand Up @@ -53,6 +53,12 @@ cp -af www/* ${WWW_DIR}/
# Copy config files
cp -af etc/* ${ETC_DIR}/

# Create configuration file, if it does not already exist.
if [[ ! -e ${ADDON_DIR}/ccu-jack.cfg ]]; then
echo "Creating configuration file"
cp ${ADDON_DIR}/ccu-jack-default.cfg ${ADDON_DIR}/ccu-jack.cfg
fi

# Add menu entry
cp -af addon/update_hm_addons.tcl ${ADDON_DIR}/
${ADDON_DIR}/update_hm_addons.tcl -a ${ADDON_ID} -name "${ADDON_NAME}" -url /addons/${ADDON_ID}/config.cgi -de "${ADDON_DESCR_DE}" -en "${ADDON_DESCR_EN}"
Expand Down
6 changes: 4 additions & 2 deletions vmodel/device.go
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/mdzio/go-hmccu/itf"
"github.com/mdzio/go-hmccu/script"
"github.com/mdzio/go-logging"
"github.com/mdzio/go-veap"
"github.com/mdzio/go-veap/model"
"github.com/mdzio/go-logging"
)

const (
Expand Down Expand Up @@ -422,7 +422,9 @@ func (c *device) GetDescription() string {
}

func (c *device) ReadAttributes() veap.AttrValues {
return deviceDescrToAttr(c.descr)
attr := deviceDescrToAttr(c.descr)
attr["interfaceType"] = c.itfClient.ReGaHssID
return attr
}

type channel struct {
Expand Down

0 comments on commit 1f94b2f

Please sign in to comment.