mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
use timestampFormat also for add and clear
git-svn-id: https://svn.fhem.de/fhem/trunk@5906 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d553805a41
commit
99a9cb7c18
@ -320,10 +320,16 @@ readingsHistory_detailFn()
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
readingsHistory_Notify($$$)
|
makeTimestamp($$) {
|
||||||
{
|
my ($t, $timestampFormat) = @_;
|
||||||
my ($hash,$reading,$value) = @_;
|
|
||||||
|
my @lt = localtime($t);
|
||||||
|
|
||||||
|
return strftime( $timestampFormat, @lt ) if( $timestampFormat );
|
||||||
|
|
||||||
|
return sprintf("%02d:%02d:%02d", $lt[2], $lt[1], $lt[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
readingsHistory_Notify($$)
|
readingsHistory_Notify($$)
|
||||||
{
|
{
|
||||||
@ -440,13 +446,7 @@ readingsHistory_Notify($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $t = time;
|
my $t = time;
|
||||||
my @lt = localtime($t);
|
my $tm = makeTimestamp( $t, $timestampFormat );
|
||||||
my $tm;
|
|
||||||
if( $timestampFormat ) {
|
|
||||||
$tm = strftime( $timestampFormat, @lt );
|
|
||||||
} else {
|
|
||||||
$tm = sprintf("%02d:%02d:%02d", $lt[2], $lt[1], $lt[0] );
|
|
||||||
}
|
|
||||||
|
|
||||||
my $show_links = !AttrVal( $name, "nolinks", "0" );
|
my $show_links = !AttrVal( $name, "nolinks", "0" );
|
||||||
$show_links = 0 if($FW_hiddenroom{detail});
|
$show_links = 0 if($FW_hiddenroom{detail});
|
||||||
@ -575,8 +575,7 @@ readingsHistory_Set($@)
|
|||||||
$hash->{fhem}{history} = [];
|
$hash->{fhem}{history} = [];
|
||||||
|
|
||||||
my $t = time;
|
my $t = time;
|
||||||
my @lt = localtime($t);
|
my $tm = makeTimestamp( time, AttrVal( $name, "timestampFormat", undef) );
|
||||||
my $tm = sprintf("%02d:%02d:%02d", $lt[2], $lt[1], $lt[0] );
|
|
||||||
my $msg = "$tm --clear--";
|
my $msg = "$tm --clear--";
|
||||||
|
|
||||||
my $entry = [$t,"", $cmd, $msg];
|
my $entry = [$t,"", $cmd, $msg];
|
||||||
@ -588,8 +587,7 @@ readingsHistory_Set($@)
|
|||||||
return undef;
|
return undef;
|
||||||
} elsif ( $cmd eq "add" ) {
|
} elsif ( $cmd eq "add" ) {
|
||||||
my $t = time;
|
my $t = time;
|
||||||
my @lt = localtime($t);
|
my $tm = makeTimestamp( time, AttrVal( $name, "timestampFormat", undef) );
|
||||||
my $tm = sprintf("%02d:%02d:%02d", $lt[2], $lt[1], $lt[0] );
|
|
||||||
my $msg = "$tm $param ". join( " ", @a );
|
my $msg = "$tm $param ". join( " ", @a );
|
||||||
|
|
||||||
my $entry = [$t,"", "$param ". join( " ", @a ),$msg];
|
my $entry = [$t,"", "$param ". join( " ", @a ),$msg];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user