git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1351 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ulimaass 2012-03-15 19:13:26 +00:00
parent af99086b97
commit 4a91a94556

View File

@ -2,24 +2,25 @@ package main;
use strict; use strict;
use warnings; use warnings;
use POSIX; use POSIX;
my @wert;
my $div_class;
sub doMakeHtml($@);
######################################################################################
sub sub
myFloorplanList_Initialize($$) myFloorplanList_Initialize($$)
{ {
my ($hash) = @_; my ($hash) = @_;
} }
################################################################################### ###################################################################################
# Einbinden in fhem mit # Define in fhem by
# define w_WertListe1 weblink htmlCode {doWertListe1()} # define w_WertListe1 weblink htmlCode {doWertListe1()}
# attr w_WertListe1 room Listen # attr w_WertListe1 room Listen
# #
sub sub
doWertListe1() { doWertListe1() {
my @wert; $div_class = "WertListe"; #format in css-file using #WertListe
my $div_class = "WertListe"; #format in css-file using #WertListe
# vvvvvvvvvvvvv Change this list as needed vvvvvvvvvvvvvvv
# Change this list as needed
$wert[0] = "FHT Ist:" .','. ReadingsVal("ez_FHT","measured-temp","ezFHT measured-temp Fehler"); $wert[0] = "FHT Ist:" .','. ReadingsVal("ez_FHT","measured-temp","ezFHT measured-temp Fehler");
$wert[1] = "FHT Soll:" .','. ReadingsVal("ez_FHT","desired-temp","ezFHT desired-temp Fehler"); $wert[1] = "FHT Soll:" .','. ReadingsVal("ez_FHT","desired-temp","ezFHT desired-temp Fehler");
$wert[2] = "FHT Actuator:" .','. ReadingsVal("ez_FHT","actuator","ezFHT actuator Fehler"); $wert[2] = "FHT Actuator:" .','. ReadingsVal("ez_FHT","actuator","ezFHT actuator Fehler");
@ -28,15 +29,45 @@ doWertListe1() {
$wert[5] = "GoogleTemp:" .','. ReadingsVal("MunichWeather","temperature","MunichWeather temperature Error"); $wert[5] = "GoogleTemp:" .','. ReadingsVal("MunichWeather","temperature","MunichWeather temperature Error");
$wert[6] = "GoogleSky:" .','. ReadingsVal("MunichWeather","condition","MunichWeather condition Error"); $wert[6] = "GoogleSky:" .','. ReadingsVal("MunichWeather","condition","MunichWeather condition Error");
$wert[7] = "GoogleIcon:" .','. "<img src=\"http://www.google.com".ReadingsVal("MunichWeather","icon","MunichWeather icon Error")."\">"; $wert[7] = "GoogleIcon:" .','. "<img src=\"http://www.google.com".ReadingsVal("MunichWeather","icon","MunichWeather icon Error")."\">";
my $FritzTemp = `ctlmgr_ctl r power status/act_temperature` ; my $FritzTemp = `ctlmgr_ctl r power status/act_temperature` ; # read FritzBox internal temperature
$wert[8] = "FritzBoxTemp:" .','. $FritzTemp . "&deg"; $wert[8] = "FritzBoxTemp:" .','. $FritzTemp . "&deg"; # print FritzBox internal temperature
# Change this list as needed # ^^^^^^^^^^^^^ Change this list as needed ^^^^^^^^^^^^^^^
return doMakeHtml($div_class, @wert);
}
###################################################################################
# Define in fhem by
# define w_WertListe2 weblink htmlCode {doWertListe2()}
# attr w_WertListe2 room Listen
#
#sub
#doWertListe2() {
# $div_class = "WertListe"; #format in css-file using #WertListe
#
#
# vvvvvvvvvvvvv Change this list as needed vvvvvvvvvvvvvvv
# $wert[0] = "FHT Ist:" .','. ReadingsVal("ez_FHT","measured-temp","ezFHT measured-temp Fehler");
# $wert[1] = "FHT Soll:" .','. ReadingsVal("ez_FHT","desired-temp","ezFHT desired-temp Fehler");
# $wert[2] = "FHT Actuator:" .','. ReadingsVal("ez_FHT","actuator","ezFHT actuator Fehler");
# and so on
# ^^^^^^^^^^^^^ Change this list as needed ^^^^^^^^^^^^^^^
#
# return doMakeHtml($div_class, @wert);
#}
###################################################################################
# Create html-code
#
sub
doMakeHtml($@) {
my ($div_class, @line ) = @_;
my $htmlcode = '<div class="'.$div_class."\"><table>\n"; my $htmlcode = '<div class="'.$div_class."\"><table>\n";
foreach (@wert) { foreach (@line) {
my ($title, $value) = split (",",$_); my ($title, $value) = split (",",$_);
$htmlcode .= "<tr><td>$title</td><td>$value</td></tr>\n"; my $cssTitle = $title;
$cssTitle =~ s,[: -],,g;
$htmlcode .= "<tr><td><span \"$cssTitle-title\">$title</span></td><td><span \"$cssTitle-value\">$value</span></td></tr>\n";
} }
$htmlcode .= "</table></div>"; $htmlcode .= "</table></div>";
return $htmlcode; return $htmlcode;