2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

added seconds and date

git-svn-id: https://svn.fhem.de/fhem/trunk@1753 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
albauerge 2012-07-22 20:44:33 +00:00
parent db91447cd2
commit 68193527ab

View File

@ -227,6 +227,29 @@ RSS_itemTime {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
RSS_itemText($S,$x,$y,sprintf("%02d:%02d", $hour, $min),%params);
}
sub
RSS_itemSeconds {
my ($S,$x,$y,$format,%params)= @_;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($format eq "colon")
{
RSS_itemText($S,$x,$y,sprintf(":%02d", $sec),%params);
}
else
{
RSS_itemText($S,$x,$y,sprintf("%02d", $sec),%params);
}
}
sub
RSS_itemDate {
my ($S,$x,$y,%params)= @_;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
RSS_itemText($S,$x,$y,sprintf("%02d.%02d.%04d", $mday, $mon+1, $year+1900),%params);
}
sub
RSS_itemGif {
@ -255,7 +278,7 @@ RSS_evalLayout($$@) {
$params{pt}= 12;
$params{rgb}= "ffffff";
my ($x,$y,$text,$host,$filename);
my ($x,$y,$text,$host,$filename,$format);
my $cont= "";
foreach my $line (@layout) {
@ -286,7 +309,13 @@ RSS_evalLayout($$@) {
} elsif($cmd eq "time") {
($x,$y)= split("[ \t]+", $def, 2);
RSS_itemTime($S,$x,$y,%params);
} elsif($cmd eq "gif") {
} elsif($cmd eq "seconds") {
($x,$y,$format) = split("[ \+]", $def,3);
RSS_itemSeconds($S,$x,$y,$format,%params);
} elsif($cmd eq "date") {
($x,$y)= split("[ \t]+", $def, 2);
RSS_itemDate($S,$x,$y,%params);
} elsif($cmd eq "gif") {
($x,$y,$host,$filename)= split("[ \t]+", $def,4);
my $fn= AnalyzePerlCommand(undef, $filename);
RSS_itemGif($S,$x,$y,$host,$fn,%params);
@ -422,3 +451,4 @@ RSS_CGI(){
1;