Skip to content

Commit

Permalink
Merge pull request #25 from jp112sdl/dev
Browse files Browse the repository at this point in the history
add HB-LC-Bl1-Velux
  • Loading branch information
jp112sdl authored May 3, 2020
2 parents 335e84b + 2223360 commit ce32f84
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/addon/firmware/rftypes/hb-lc-bl1-fm-bat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<parameter index="9.0" size="1.0" cond_op="GE" const_value="0x01"/>
<parameter index="10.0" size="2.0" const_value="0xf321"/>
</type>
<type name="battery powered radio-controlled blind actuator 1-channel for Velux" id="HB-LC-Bl1-Velux" priority="2">
<parameter index="10.0" size="2.0" const_value="0xf20a"/>
</type>
</supported_types>
<paramset type="MASTER" id="blind_dev_master">
<parameter id="INTERNAL_KEYS_VISIBLE" ui_flags="internal">
Expand Down Expand Up @@ -38,6 +41,10 @@
<logical type="boolean"/>
<physical type="integer" interface="internal" value_id="CONFIG_PENDING"/>
</parameter>
<parameter id="LOWBAT" operations="read,event" ui_flags="service">
<logical type="boolean" />
<physical type="integer" interface="internal" value_id="LOWBAT" />
</parameter>
<parameter id="AES_KEY" operations="read" ui_flags="invisible">
<logical type="integer" min="0" max="127"/>
<physical type="integer" interface="internal" value_id="AES_KEY"/>
Expand Down
34 changes: 34 additions & 0 deletions src/addon/install_hb-lc-bl1-fm-bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,37 @@ webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['250'] = '\/config\/img\/devices
if [ -z "`cat $webuiFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($webuiSearch\)/\1$webuiInsert/g" $webuiFile
fi

#######################################

DEVICE="HB-LC-Bl1-Velux"
DEVICE_IMG=7_hm-lc-bl1-fm.png
DEVICE_THUMB=7_hm-lc-bl1-fm_thumb.png
DEVICE_DESC="battery powered radio-controlled blind actuator 1-channel for Velux"

### Edit DEVDB.tcl ###
devdescrFile="/www/config/devdescr/DEVDB.tcl"
devdescrSearch="array[[:space:]]*set[[:space:]]*DEV_PATHS[[:space:]]*{"

devdescrInsert="$DEVICE {{50 \/config\/img\/devices\/50\/$DEVICE_THUMB} {250 \/config\/img\/devices\/250\/$DEVICE_IMG}} "

if [ -z "`cat $devdescrFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($devdescrSearch\)/\1$devdescrInsert/g" $devdescrFile
fi

### Edit webui.js ###
webuiFile="/www/webui/webui.js"
webuiSearch="DEV_HIGHLIGHT[[:space:]]*=[[:space:]]*new Array();"

webuiInsert="\n"
webuiInsert="${webuiInsert}DEV_HIGHLIGHT['$DEVICE'] = new Object();\n"
webuiInsert="${webuiInsert}DEV_LIST.push('$DEVICE');\n"
webuiInsert="${webuiInsert}DEV_DESCRIPTION['$DEVICE']='$DEVICE_DESC';\n"
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE'] = new Object();\n"
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['50'] = '\/config\/img\/devices\/50\/$DEVICE_THUMB';\n"
webuiInsert="${webuiInsert}DEV_PATHS['$DEVICE']['250'] = '\/config\/img\/devices\/250\/$DEVICE_IMG';"

if [ -z "`cat $webuiFile | grep \"$DEVICE\"`" ]; then
sed -i "s/\($webuiSearch\)/\1$webuiInsert/g" $webuiFile
fi

10 changes: 10 additions & 0 deletions src/addon/uninstall_hb-lc-bl1-fm-bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@ sed -i "s/\($devdescrSearch\)//g" $devdescrFile
webuiFile="/www/webui/webui.js"
sed -i "/\($DEVICE\)/d" $webuiFile


DEVICE="HB-LC-Bl1-Velux"

devdescrSearch="$DEVICE {{50 \/config\/img\/devices\/50\/$DEVICE_THUMB} {250 \/config\/img\/devices\/250\/$DEVICE_IMG}} "
sed -i "s/\($devdescrSearch\)//g" $devdescrFile

webuiFile="/www/webui/webui.js"
sed -i "/\($DEVICE\)/d" $webuiFile


rm -f $FIRMWARE_FILE

0 comments on commit ce32f84

Please sign in to comment.