mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
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:
parent
830972f2f8
commit
0880ee69d9
@ -24,7 +24,7 @@
|
|||||||
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Version: 1.2.1
|
# Version: 1.2.2
|
||||||
#
|
#
|
||||||
# Major Version History:
|
# Major Version History:
|
||||||
# - 1.2.0 - 2013-12-21
|
# - 1.2.0 - 2013-12-21
|
||||||
@ -738,9 +738,18 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
if ( defined( $eventinfo->{e2event}{$e2reading} )
|
if ( defined( $eventinfo->{e2event}{$e2reading} )
|
||||||
&& $eventinfo->{e2event}{$e2reading} ne "0" )
|
&& $eventinfo->{e2event}{$e2reading} ne "0" )
|
||||||
{
|
{
|
||||||
my $timestring =
|
my $timestring;
|
||||||
substr( FmtDateTime( $eventinfo->{e2event}{$e2reading} ),
|
if ( $_ eq "eventduration" ) {
|
||||||
10 );
|
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} )
|
if ( !defined( $hash->{READINGS}{$reading}{VAL} )
|
||||||
|| $hash->{READINGS}{$reading}{VAL} ne $timestring )
|
|| $hash->{READINGS}{$reading}{VAL} ne $timestring )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user