ENIGMA2: fix calculation of eventduration_hr

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4505 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2013-12-30 02:00:58 +00:00
parent 830972f2f8
commit 0880ee69d9

View File

@ -24,7 +24,7 @@
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
#
#
# Version: 1.2.1
# Version: 1.2.2
#
# Major Version History:
# - 1.2.0 - 2013-12-21
@ -738,9 +738,18 @@ sub ENIGMA2_GetStatus($;$) {
if ( defined( $eventinfo->{e2event}{$e2reading} )
&& $eventinfo->{e2event}{$e2reading} ne "0" )
{
my $timestring =
substr( FmtDateTime( $eventinfo->{e2event}{$e2reading} ),
10 );
my $timestring;
if ( $_ eq "eventduration" ) {
my @t = localtime( $eventinfo->{e2event}{$e2reading} );
$timestring =
sprintf( "%02d:%02d:%02d", $t[2] - 1, $t[1], $t[0] );
}
else {
$timestring =
substr(
FmtDateTime( $eventinfo->{e2event}{$e2reading} ),
11 );
}
if ( !defined( $hash->{READINGS}{$reading}{VAL} )
|| $hash->{READINGS}{$reading}{VAL} ne $timestring )
{