Skip to content

Commit

Permalink
Merge pull request #173 from marvin-w/feature/sync_upstream_changes
Browse files Browse the repository at this point in the history
Updated synchronising scripts due to changed component structure
  • Loading branch information
marvin-w committed Feb 8, 2019
2 parents 9cd4edd + 0b677d2 commit 3543ea6
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 85 deletions.
4 changes: 4 additions & 0 deletions home-assistant-plugin/.config.template
@@ -0,0 +1,4 @@
# base path to ha upstream
export HA_UPSTREAM=
# base path to the xknx repo
export XKNX_REPO=
1 change: 1 addition & 0 deletions home-assistant-plugin/.gitignore
@@ -0,0 +1 @@
.config
13 changes: 6 additions & 7 deletions home-assistant-plugin/README.md
Expand Up @@ -6,18 +6,17 @@ See documentation at [http://xknx.io/home_assistant](http://xknx.io/home_assista
Merge upstream in XKNX
-------------

Use the `merge_from_upstream.pl` script to update the KNX component to the latest HA version.
Use the `merge_from_upstream.sh` script to update the KNX component to the latest HA version.
It will copy all the files from your HA installation into the local XKNX repository.

Please make sure you read the instructions in the `merge_from_upstream.pl` script first before
you do this as it will override all changes in the XKNX repository with those from HA.
Please create a config file called `.config`. There is a template file called `.config.template`
which you can use as a starting point.

Merge XKNX changes into HA
-------------

Use the `merge_to_upstream.pl` script to update the HA KNX component to the current XKNX version.
Use the `merge_to_upstream.sh` script to update the HA KNX component to the current XKNX version.
It will copy all the files from your local XKNX repository to the HA repository.

Please make sure you read the instructions in the `merge_to_upstream.pl` script first before
you do this as it will override all changes in the HA component that were made to the KNX
component(s).
Please create a config file called `.config`. There is a template file called `.config.template`
which you can use as a starting point.
39 changes: 0 additions & 39 deletions home-assistant-plugin/merge_from_upstream.pl

This file was deleted.

29 changes: 29 additions & 0 deletions home-assistant-plugin/merge_from_upstream.sh
@@ -0,0 +1,29 @@
#!/bin/bash

if [[ -f .config ]]; then
source .config
else
echo "Please create the .config file containing the HA_UPSTREAM and the XKNX_REPO variables"
exit 1
fi

if [[ ! -d ${XKNX_REPO}/home-assistant-plugin ]]; then
echo "XKNX repo path is wrong"
exit 1
fi

if [[ ! -d ${HA_UPSTREAM}/homeassistant ]]; then
echo "HA upstream repo path is wrong"
exit 1
fi

rm -f ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py
cp ${HA_UPSTREAM}/homeassistant/components/knx/* ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/
sed -i '.bak' 's/homeassistant.components.knx/custom_components.xknx/g' ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py
sed -i '.bak' "s/DEPENDENCIES = \\['knx'\\]/DEPENDENCIES = \\['xknx'\\]/g" ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py
sed -i '.bak' "s/DEFAULT_NAME = 'KNX/DEFAULT_NAME = 'XKNX/g" ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py
sed -i '.bak' "s/_KNX_/_XKNX_/g" ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py
sed -i '.bak' "s/DATA_KNX/DATA_XKNX/g" ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py
sed -i '.bak' "s/DOMAIN = \"knx\"/DOMAIN = \"xknx\"/g" ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py

rm -f ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/*.py.bak
39 changes: 0 additions & 39 deletions home-assistant-plugin/merge_to_upstream.pl

This file was deleted.

29 changes: 29 additions & 0 deletions home-assistant-plugin/merge_to_upstream.sh
@@ -0,0 +1,29 @@
#!/bin/bash

if [[ -f .config ]]; then
source .config
else
echo "Please create the .config file containing the HA_UPSTREAM and the XKNX_REPO variables"
exit 1
fi

if [[ ! -d ${XKNX_REPO}/home-assistant-plugin ]]; then
echo "XKNX repo path is wrong"
exit 1
fi

if [[ ! -d ${HA_UPSTREAM}/homeassistant ]]; then
echo "HA upstream repo path is wrong"
exit 1
fi

rm -f ${HA_UPSTREAM}/homeassistant/components/knx/*
cp ${XKNX_REPO}/home-assistant-plugin/custom_components/xknx/* ${HA_UPSTREAM}/homeassistant/components/knx/
sed -i '.bak' 's/custom_components.xknx/homeassistant.components.knx/g' ${HA_UPSTREAM}/homeassistant/components/knx/*.py
sed -i '.bak' "s/DEPENDENCIES = \\['xknx'\\]/DEPENDENCIES = \\['knx'\\]/g" ${HA_UPSTREAM}/homeassistant/components/knx/*.py
sed -i '.bak' "s/DEFAULT_NAME = 'XKNX/DEFAULT_NAME = 'KNX/g" ${HA_UPSTREAM}/homeassistant/components/knx/*.py
sed -i '.bak' "s/_XKNX_/_KNX_/g" ${HA_UPSTREAM}/homeassistant/components/knx/*.py
sed -i '.bak' "s/DATA_XKNX/DATA_KNX/g" ${HA_UPSTREAM}/homeassistant/components/knx/*.py
sed -i '.bak' "s/DOMAIN = \"xknx\"/DOMAIN = \"knx\"/g" ${HA_UPSTREAM}/homeassistant/components/knx/*.py

rm -f ${HA_UPSTREAM}/homeassistant/components/knx/*.py.bak

0 comments on commit 3543ea6

Please sign in to comment.