mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +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:
parent
db91447cd2
commit
68193527ab
@ -227,6 +227,29 @@ RSS_itemTime {
|
|||||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||||
RSS_itemText($S,$x,$y,sprintf("%02d:%02d", $hour, $min),%params);
|
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
|
sub
|
||||||
RSS_itemGif {
|
RSS_itemGif {
|
||||||
@ -255,7 +278,7 @@ RSS_evalLayout($$@) {
|
|||||||
$params{pt}= 12;
|
$params{pt}= 12;
|
||||||
$params{rgb}= "ffffff";
|
$params{rgb}= "ffffff";
|
||||||
|
|
||||||
my ($x,$y,$text,$host,$filename);
|
my ($x,$y,$text,$host,$filename,$format);
|
||||||
|
|
||||||
my $cont= "";
|
my $cont= "";
|
||||||
foreach my $line (@layout) {
|
foreach my $line (@layout) {
|
||||||
@ -286,7 +309,13 @@ RSS_evalLayout($$@) {
|
|||||||
} elsif($cmd eq "time") {
|
} elsif($cmd eq "time") {
|
||||||
($x,$y)= split("[ \t]+", $def, 2);
|
($x,$y)= split("[ \t]+", $def, 2);
|
||||||
RSS_itemTime($S,$x,$y,%params);
|
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);
|
($x,$y,$host,$filename)= split("[ \t]+", $def,4);
|
||||||
my $fn= AnalyzePerlCommand(undef, $filename);
|
my $fn= AnalyzePerlCommand(undef, $filename);
|
||||||
RSS_itemGif($S,$x,$y,$host,$fn,%params);
|
RSS_itemGif($S,$x,$y,$host,$fn,%params);
|
||||||
@ -422,3 +451,4 @@ RSS_CGI(){
|
|||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user