Skip to content

Commit

Permalink
updated upnp/basic_dev.cgi accordingly.
Browse files Browse the repository at this point in the history
  • Loading branch information
jens-maus committed Jun 25, 2018
1 parent 92713ca commit d75c599
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 72 deletions.

This file was deleted.

38 changes: 18 additions & 20 deletions buildroot-external/patches/occu/0020-WebUI-Fix-BasicDevCGI.patch
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
--- occu/WebUI/www/upnp/basic_dev.cgi.orig
+++ occu/WebUI/www/upnp/basic_dev.cgi
@@ -14,7 +14,7 @@
@@ -14,7 +14,14 @@
}

proc get_serial_number {} {
- return [exec cat /sys/module/plat_eq3ccu2/parameters/board_serial]
+ return [exec cat /var/board_serial]
+ set serial [exec cat /var/board_sgtin]
+ if { "$serial" == "" } {
+ set serial [exec cat /var/board_serial]
+ }
+ if { "$serial" == "" } {
+ set serial [exec cat /sys/module/plat_eq3ccu2/parameters/board_serial]
+ }
+ return $serial
}

proc get_hostname {} {
@@ -22,19 +22,19 @@
@@ -22,10 +29,14 @@
}

set hostname "[get_hostname]"
-if { "$hostname" == "homematic-ccu2" } {
- set RESOURCE(TITLE) "HomeMatic Central CCU2"
+if { "$hostname" == "homematic-raspi" } {
+ set RESOURCE(TITLE) "RaspberryMatic CCU"
+if { "$hostname" == "homematic-ccu3" } {
+ set RESOURCE(TITLE) "HomeMatic Central CCU3"
+} elseif { "$hostname" == "homematic-raspi" } {
+ set RESOURCE(TITLE) "HomeMatic Central RaspberryMatic"
+} elseif { "$hostname" == "homematic-ccu2" } {
set RESOURCE(TITLE) "HomeMatic Central CCU2"
} else {
set RESOURCE(TITLE) "$hostname"
- set RESOURCE(TITLE) "$hostname"
+ set RESOURCE(TITLE) "HomeMatic Central - $hostname"
}

set RESOURCE(MANUFACTURER) "EQ3"
set RESOURCE(MANUFACTURER_URL) "http://www.homematic.com"
-set RESOURCE(PRESENTATION_URL) ""
+set RESOURCE(PRESENTATION_URL) "http://$hostname/"
set RESOURCE(DESCRIPTION) "HomeMatic Central [get_serial_number]"
-set RESOURCE(MODEL_NAME) "HomeMatic Central"
-set RESOURCE(MODEL_NUMBER) "HomeMatic Central"
-set RESOURCE(MODEL_URL) $RESOURCE(MANUFACTURER_URL)
+set RESOURCE(MODEL_NAME) "RaspberryMatic"
+set RESOURCE(MODEL_NUMBER) "RaspberryMatic"
+set RESOURCE(MODEL_URL) "https://github.com/jens-maus/RaspberryMatic"
set RESOURCE(SERIAL_NUMBER) "[get_serial_number]"
set RESOURCE(UUID) "upnp-BasicDevice-1_0-$RESOURCE(SERIAL_NUMBER)"
set RESOURCE(UPC) "123456789002"
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,38 @@ proc get_ip_address {} {
}

proc get_serial_number {} {
return [exec cat /var/board_serial]
set serial [exec cat /var/board_sgtin]
if { "$serial" == "" } {
set serial [exec cat /var/board_serial]
}
if { "$serial" == "" } {
set serial [exec cat /sys/module/plat_eq3ccu2/parameters/board_serial]
}
return $serial
}

proc get_hostname {} {
return [exec hostname]
}

set hostname "[get_hostname]"
if { "$hostname" == "homematic-raspi" } {
set RESOURCE(TITLE) "RaspberryMatic CCU"
if { "$hostname" == "homematic-ccu3" } {
set RESOURCE(TITLE) "HomeMatic Central CCU3"
} elseif { "$hostname" == "homematic-raspi" } {
set RESOURCE(TITLE) "HomeMatic Central RaspberryMatic"
} elseif { "$hostname" == "homematic-ccu2" } {
set RESOURCE(TITLE) "HomeMatic Central CCU2"
} else {
set RESOURCE(TITLE) "$hostname"
set RESOURCE(TITLE) "HomeMatic Central - $hostname"
}

set RESOURCE(MANUFACTURER) "EQ3"
set RESOURCE(MANUFACTURER_URL) "http://www.homematic.com"
set RESOURCE(PRESENTATION_URL) "http://$hostname/"
set RESOURCE(PRESENTATION_URL) ""
set RESOURCE(DESCRIPTION) "HomeMatic Central [get_serial_number]"
set RESOURCE(MODEL_NAME) "RaspberryMatic"
set RESOURCE(MODEL_NUMBER) "RaspberryMatic"
set RESOURCE(MODEL_URL) "https://github.com/jens-maus/RaspberryMatic"
set RESOURCE(MODEL_NAME) "HomeMatic Central"
set RESOURCE(MODEL_NUMBER) "HomeMatic Central"
set RESOURCE(MODEL_URL) $RESOURCE(MANUFACTURER_URL)
set RESOURCE(SERIAL_NUMBER) "[get_serial_number]"
set RESOURCE(UUID) "upnp-BasicDevice-1_0-$RESOURCE(SERIAL_NUMBER)"
set RESOURCE(UPC) "123456789002"
Expand Down

0 comments on commit d75c599

Please sign in to comment.