2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

PROPLANTA: fc0_date

git-svn-id: https://svn.fhem.de/fhem/trunk@7353 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch 2014-12-29 14:19:34 +00:00
parent 863fb54ab9
commit 7712e8d8c4

View File

@ -53,6 +53,7 @@ my $curReadingType = 0;
# 6 = Time Col 3
# 7 = Image Col 2-5
# 8 = MinMaxNummer Col 3
# 9 = Date Col 2-5
my @knownNoneIDs = ( ["Temperatur", "temperature", 1]
,["relative Feuchte", "humidity", 1]
,["Sichtweite", "visibility", 1]
@ -65,7 +66,8 @@ my $curReadingType = 0;
# 1 = Tag-ID, 2 = readingName, 3 = Tag-Type (see above)
my @knownIDs = (
["TMAX", "tempMax", 2]
["DATUM", "date", 9]
,["TMAX", "tempMax", 2]
,["TMIN", "tempMin", 2]
,["NW", "chOfRainDay", 2]
,["NW_Nacht", "chOfRainNight", 2]
@ -148,6 +150,15 @@ sub text
$text =~ s/^\s+//; # trim string
$text =~ s/\s+$//;
$text =~ s/0/0/g; # replace 0
$text =~ s/1/1/g; # replace 1
$text =~ s/2/2/g; # replace 2
$text =~ s/3/3/g; # replace 3
$text =~ s/4/4/g; # replace 4
$text =~ s/5/5/g; # replace 5
$text =~ s/6/6/g; # replace 6
$text =~ s/7/7/g; # replace 7
$text =~ s/8/8/g; # replace 8
$text =~ s/9/9/g; # replace 9
# Tag-Type 0 = Check for readings without tag-ID (current readings)
if ($curReadingType == 0)
@ -263,6 +274,15 @@ sub text
}
}
}
# Tag-Type 9 = Date Col 2-5
elsif ($curReadingType == 9)
{
if ( 1 < $curCol && $curCol <= 5 )
{
$readingName = "fc".($startDay+$curCol-2)."_".$curReadingName;
push( @texte, $readingName."|".$text );
}
}
}
}
@ -692,12 +712,12 @@ PROPLANTA_Html($)
my $ret = "<table border=0><thead align=center>";
$ret .= sprintf '<tr><th colspan=9 align=left>%s</th></tr>', $defs{$d}{DEF};
$ret .= sprintf '<tr><th>Tag</th><th>morgens</th><th>tags</th><th>abends</th><th>nachts</th><th>min</th><th>max</th><th>Regen tags</th><th>Frost</th></tr></thead>', $defs{$d}{DEF};
$ret .= sprintf '<tr><th>Tag</th><th>morgens</th><th>tagsueber</th><th>abends</th><th>nachts</th><th>min</th><th>max</th><th>Regen tags</th><th>Frost</th></tr></thead>', $defs{$d}{DEF};
$ret .= "<tbody align=center>";
# define MyForecast weblink htmlCode { PROPLANTA_Html("ProPlanta_Wetter") }
for(my $i=0; $i<=2; $i++) {
$ret .= sprintf('<tr><td>%s</td><td>%s<br><img src="%s"></td><td>%s<br><img src="%s"></td><td>%s<br><img src="%s"></td><td>%s<br><img src="%s"></td><td>%s&deg;C</td><td>%s&deg;C</td><td>%s %%</td><td>%s</td></tr>',
"Tag ".$i,
ReadingsVal($d, "fc".$i."_date", ""),
ReadingsVal($d, "fc".$i."_weatherMorning", ""), ReadingsVal($d, "fc".$i."_weatherMorningIcon", ""),
ReadingsVal($d, "fc".$i."_weatherDay", ""), ReadingsVal($d, "fc".$i."_weatherDayIcon", ""),
ReadingsVal($d, "fc".$i."_weatherEvening", ""), ReadingsVal($d, "fc".$i."_weatherEveningIcon", ""),