From 2ec50eaec37dba527d872ee3a5f4265c4889b7cd Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 16 Feb 2016 11:44:10 +0100 Subject: [PATCH] =?UTF-8?q?Formatierung=20f=C3=BCr=20lastClean=20eingebaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 74_HOMBOT.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/74_HOMBOT.pm b/74_HOMBOT.pm index b097125..ca04f89 100644 --- a/74_HOMBOT.pm +++ b/74_HOMBOT.pm @@ -35,7 +35,7 @@ use Time::HiRes qw(gettimeofday); use HttpUtils; use Blocking; -my $version = "0.2.1"; +my $version = "0.2.3"; @@ -48,6 +48,7 @@ sub HOMBOT_Initialize($) { $hash->{DefFn} = "HOMBOT_Define"; $hash->{UndefFn} = "HOMBOT_Undef"; $hash->{AttrFn} = "HOMBOT_Attr"; + $hash->{FW_detailFn} = "HOMBOT_DetailFn"; $hash->{AttrList} = "interval ". "disable:1 ". @@ -456,11 +457,18 @@ sub HOMBOT_RetrieveHomebotInfoFinished($$$) { $t =~ s/JSON_TURBO/turbo/g; $t =~ s/JSON_ROBOT_STATE/hombotState/g; $t =~ s/CLREC_CURRENTBUMPING/currentBumping/g; - $t =~ s/CLREC_LAST_CLEAN/lastClean/g; + + if( $t eq "CLREC_LAST_CLEAN" ) { + my @lctime = split( '/' , $v ); + $v = $lctime[2].".".$lctime[1].".".$lctime[0]." ".$lctime[3].":".$lctime[4]; + $t = "lastClean"; + } + $t =~ s/JSON_BATTPERC/batteryPercent/g; $t =~ s/JSON_VERSION/firmware/g; $t =~ s/LGSRV_VERSION/luigiSrvVersion/g; + readingsBulkUpdate( $hash, $t, $v ) if( $t =~ m/[a-z]/s && defined( $t ) && defined( $v ) ); } @@ -963,6 +971,16 @@ sub HOMBOT_Aborted_Bot_Alive($) { Log3 $name, 3, "HOMBOT ($name) - The BlockingCall Process terminated unexpectedly. Timedout"; } +sub HOMBOT_DetailFn() { # Patch von Andre (justme1968) + + my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn. + my $hash = $defs{$d}; + + return if( !defined( $hash->{HOST} ) ); + + return "{HOST}:6260\" target=\"_blank\">Control Center
" +} +