Skip to content

Commit ae1c773

Browse files
committed
Harmony Plugin shorter serial number
RM Installer npmrc fix
1 parent e83466d commit ae1c773

File tree

6 files changed

+53
-15
lines changed

6 files changed

+53
-15
lines changed

plugins/LogitechHarmony/HarmonyClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ HarmonyClient.prototype.init = function() {
3232
var that = this;
3333
HomematicDevice = this.server.homematicDevice;
3434
this.hmDevice = new HomematicDevice(this.name);
35-
var serial = "HarmonyActivities";
35+
var serial = "HarmonyAct";
3636
var data = this.bridge.deviceDataWithSerial(serial);
3737
if (data!=undefined) {
3838
this.hmDevice.initWithStoredData(data);

plugins/LogitechHarmony/HarmonyPlatform.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var appRoot = path.dirname(require.main.filename)
2222
if (appRoot.endsWith('bin')) { appRoot = path.join(appRoot, '..','lib'); }
2323
if (appRoot.endsWith('node_modules/daemonize2/lib')) { appRoot = path.join(appRoot,'..','..','..','node_modules','homematic-virtual-interface','lib')}
2424
appRoot = path.normalize(appRoot);
25+
26+
2527
var HomematicVirtualPlatform = require(appRoot + '/HomematicVirtualPlatform.js');
2628

2729

@@ -119,7 +121,7 @@ HarmonyPlatform.prototype.showSettings = function(dispatched_request) {
119121
var result = [];
120122

121123
var localPort = this.config.getValueForPluginWithDefault(this.name,"port",7000);
122-
var localHostIP = this.config.getValueForPluginWithDefault(this.name,"host",this.hm_layer.getIPAddress());
124+
var localHostIP = this.config.getValueForPluginWithDefault(this.name,"host",this.config.getIPAddress());
123125
var hub_ip = this.config.getValueForPluginWithDefault(this.name,"hub_ip","");
124126
var hue_plugin_name = this.config.getValueForPluginWithDefault(this.name,"hue_plugin_name","");
125127

plugins/LogitechHarmony/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "homematic-virtual-harmonydevice",
3-
"version": "0.0.18",
3+
"version": "0.0.20",
44
"description": "Virtual Harmony Device",
55
"license": "ISC",
66
"keywords": [

raspberrymatic_installer/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
If you want to use this on an <a href="https://github.com/jens-maus/RaspberryMatic">Raspberrymatic CCU</a> , please use this <a href="https://github.com/thkl/Homematic-Virtual-Interface/blob/master/raspberrymatic_installer/hvl-raspb-0.0.2.tar.gz">CCU Addon</a>. The addon will fetch all necessary files from the web at the first launch. So please note: You will need internet access on your CCU.
22

33
The Raspberrymatic Version does not need any manual setup. Just use the WebInterface to fetch new plugins and set them up.
4+
5+
0.0.6 -> Rebuild .npmrc on every boot

raspberrymatic_installer/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.5
1+
0.0.6

raspberrymatic_installer/etc/postinstall.sh

+45-11
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,64 @@ if [ ! -f ${ADDON_DIR}/node_modules/homematic-virtual-interface/lib/index.js ];
99
mkdir -p ${WWW_DIR}
1010
chmod 755 ${WWW_DIR}
1111

12+
echo "[Installer]Start installer" >>/var/log/hvl.log
13+
echo "[Installer]Program Dir is ${ADDON_DIR}" >>/var/log/hvl.log
14+
1215
#install node and fetch the core module
1316
cd ${ADDON_DIR}
1417

18+
echo "[Installer]Installing node" >>/var/log/hvl.log
19+
1520
wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-armv7l.tar.xz -Onode.tar.xz --no-check-certificate
1621
tar xf node.tar.xz
1722
rm node.tar.xz
1823
mv node-v6.10.0-linux-armv7l node
24+
25+
echo "[Installer]Switch Root FS to RW" >>/var/log/hvl.log
26+
1927
# since the settingsfile of npm is located in /root/.npm we need rw on the root filesystem
2028
mount -o remount,rw /
2129

30+
echo "[Installer]mk cache dir ${ADDON_DIR}/.npm" >>/var/log/hvl.log
31+
cd ${ADDON_DIR}
32+
mkdir ${ADDON_DIR}/.npm
33+
2234
echo "cache=/usr/local/addons/hvl/.npm" > /root/.npmrc
2335
echo "init-module=/usr/local/addons/hvl/.npm-init.js" >> /root/.npmrc
2436
echo "userconfig=/usr/local/addons/hvl/.npmrc" >> /root/.npmrc
2537
echo "path=/usr/local/addons/hvl/.npm" >> /root/.npmrc
2638

2739

28-
# Add Interface Template
29-
if [ $(cat /etc/config_templates/InterfacesList.xml | grep '<name>HVL</name>' | wc -l ) -eq 0 ]; then
30-
sed -i /etc/config_templates/InterfacesList.xml -e "s/<\/interfaces>/<ipc><name>HVL<\/name><url>xmlrpc:\/\/127.0.0.1:8301<\/url><info>HVL<\/info><\/ipc><\/interfaces>/"
31-
fi
3240

3341
#install log rotator
42+
echo "[Installer]Add logrotator" >>/var/log/hvl.log
3443
cp ${ADDON_DIR}/etc/hvl.conf /etc/logrotate.d/hvl.conf
3544

45+
46+
#make .npm
47+
echo "[Installer]Build cache " >>/var/log/hvl.log
48+
${ADDON_DIR}/node/bin/node ${ADDON_DIR}/node/bin/npm config set cache ${ADDON_DIR}/.npm >>/var/log/hvl.log
49+
50+
echo "[Installer]Check cache " >>/var/log/hvl.log
51+
${ADDON_DIR}/node/bin/node ${ADDON_DIR}/node/bin/npm config get cache >>/var/log/hvl.log
52+
53+
#install the core system
54+
echo "[Installer]Install Core system" >>/var/log/hvl.log
55+
${ADDON_DIR}/node/bin/node ${ADDON_DIR}/node/bin/npm install homematic-virtual-interface >>/var/log/hvl.log
56+
57+
echo "[Installer]Switch Root FS back to RO" >>/var/log/hvl.log
3658
#switch back to read only
3759
mount -o remount,ro /
3860

39-
#install the core system
40-
${ADDON_DIR}/node/bin/node ${ADDON_DIR}/node/bin/npm install homematic-virtual-interface
4161

62+
echo "[Installer]Add Menu Buttons" >>/var/log/hvl.log
4263
#add the menu button
4364
cd /usr/local/addons/hvl/etc/
4465
chmod +x update_addon
4566
chmod +x remove_hvl_object
4667
touch /usr/local/etc/config/hm_addons.cfg
4768
/usr/local/addons/hvl/etc/update_addon hvl /usr/local/addons/hvl/etc/hvl_addon.cfg
4869

49-
# Add Interface
50-
if [ $(cat ${CONFIG_DIR}/InterfacesList.xml | grep '<name>HVL</name>' | wc -l ) -eq 0 ]; then
51-
sed -i ${CONFIG_DIR}/InterfacesList.xml -e "s/<\/interfaces>/<ipc><name>HVL<\/name><url>xmlrpc:\/\/127.0.0.1:8301<\/url><info>HVL<\/info><\/ipc><\/interfaces>/"
52-
fi
5370

5471
#link redirector
5572
ln ${ADDON_DIR}/etc/www/index.html ${WWW_DIR}/index.html
@@ -60,5 +77,22 @@ if [ ! -f ${CONFIG_DIR}/hvl/config.json ]; then
6077
sed -i ${CONFIG_DIR}/hvl/config.json -e "s/ADDON_DIR/\/usr\/local\/addons\/hvl/g"
6178
fi
6279

80+
fi
81+
82+
# Add Interface Template
83+
if [ $(cat /etc/config_templates/InterfacesList.xml | grep '<name>HVL</name>' | wc -l ) -eq 0 ]; then
84+
sed -i /etc/config_templates/InterfacesList.xml -e "s/<\/interfaces>/<ipc><name>HVL<\/name><url>xmlrpc:\/\/127.0.0.1:8301<\/url><info>HVL<\/info><\/ipc><\/interfaces>/"
85+
fi
86+
87+
# Add Interface
88+
if [ $(cat ${CONFIG_DIR}/InterfacesList.xml | grep '<name>HVL</name>' | wc -l ) -eq 0 ]; then
89+
sed -i ${CONFIG_DIR}/InterfacesList.xml -e "s/<\/interfaces>/<ipc><name>HVL<\/name><url>xmlrpc:\/\/127.0.0.1:8301<\/url><info>HVL<\/info><\/ipc><\/interfaces>/"
90+
fi
6391

64-
fi
92+
#Rebuild .npmrc on ever boot
93+
mount -o remount,rw /
94+
echo "cache=/usr/local/addons/hvl/.npm" > /root/.npmrc
95+
echo "init-module=/usr/local/addons/hvl/.npm-init.js" >> /root/.npmrc
96+
echo "userconfig=/usr/local/addons/hvl/.npmrc" >> /root/.npmrc
97+
echo "path=/usr/local/addons/hvl/.npm" >> /root/.npmrc
98+
mount -o remount,ro /

0 commit comments

Comments
 (0)