From 50308f0c17d7db5ab6ffa568f55259714089a2eb Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Sat, 7 Dec 2013 18:39:02 +0000 Subject: [PATCH] PRESENCE: "statusRequest" command for lan-bluetooth mode git-svn-id: https://svn.fhem.de/fhem/trunk@4341 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/73_PRESENCE.pm | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 49a935f43..9a7f1ca14 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,6 +1,8 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. - SVN + - feature: PRESENCE: "statusRequest" command for lan-bluetooth mode + (collectord >= 1.4, presenced >= 1.1 required) - feature: PRESENCE: new collectord package - feature: devspec: removed range, added :FILTER and more general search - feature: HUEBridge,HUEDevice: support for groups added diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index 1011f8859..ba17779a7 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -262,16 +262,26 @@ PRESENCE_Set($@) return "No Argument given" if(!defined($a[1])); - my $usage = (defined($hash->{MODE}) and $hash->{MODE} ne "lan-bluetooth" ? "Unknown argument ".$a[1].", choose one of statusRequest " : undef); + my $usage = "Unknown argument ".$a[1].", choose one of statusRequest"; if($a[1] eq "statusRequest") { if($hash->{MODE} ne "lan-bluetooth") { PRESENCE_StartLocalScan($hash, 1); - return ""; + return undef; } - + else + { + if(exists($hash->{FD})) + { + DevIo_SimpleWrite($hash, "now\n", 0); + } + else + { + return "PRESENCE Definition \"".$hash->{NAME}."\" is not connected to ".$hash->{DeviceName}; + } + } } else { @@ -1063,7 +1073,7 @@ Options: