From 937e29733b621e63ab5dfbb8fe7038b35cdbc9fb Mon Sep 17 00:00:00 2001 From: markusbloch Date: Sat, 5 Dec 2015 23:35:15 +0000 Subject: [PATCH] FB_CALLMONITOR: added attribute disabledForIntervals, more precise commandref anchors and references, minor commandref changes in general git-svn-id: https://svn.fhem.de/fhem/trunk@10106 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 + fhem/FHEM/72_FB_CALLMONITOR.pm | 131 +++++++++++++++++---------------- 2 files changed, 70 insertions(+), 64 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index d2b65545d..fa6a7070b 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +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. + - feature: FB_CALLMONITOR: added attribute disabledForIntervals to specify + specific time ranges, where FB_CALLMONITOR will be disabled + (see commandref for the exact syntax) - changed: YAMAHA_AVR: added HTTP request queue, send only one request at the same time. This increases command reliability and response behaviour of the AV receiver. diff --git a/fhem/FHEM/72_FB_CALLMONITOR.pm b/fhem/FHEM/72_FB_CALLMONITOR.pm index e6ef0be1e..302c9cf87 100755 --- a/fhem/FHEM/72_FB_CALLMONITOR.pm +++ b/fhem/FHEM/72_FB_CALLMONITOR.pm @@ -93,6 +93,7 @@ FB_CALLMONITOR_Initialize($) $hash->{NOTIFYDEV} = "global"; $hash->{AttrList} = "do_not_notify:0,1 ". "disable:0,1 ". + "disabledForIntervals ". "unique-call-ids:0,1 ". "local-area-code ". "country-code ". @@ -305,7 +306,7 @@ FB_CALLMONITOR_Read($) my $buf = DevIo_SimpleRead($hash); - return "" if(!defined($buf)); + return "" if(!defined($buf) or IsDisabled($hash->{NAME})); my $name = $hash->{NAME}; my @array; @@ -471,17 +472,9 @@ FB_CALLMONITOR_Attr($@) return FB_CALLMONITOR_loadTextFile($hash, $value); } - if($attrib eq "disable") + if($attrib eq "disable" and $value eq "1") { - if($value eq "0") - { - DevIo_OpenDev($hash, 0, undef); - } - elsif($value eq "1") - { - DevIo_CloseDev($hash); - $hash->{STATE} = "disabled"; - } + $hash->{STATE} = "disabled"; } } elsif($cmd eq "del") @@ -500,11 +493,6 @@ FB_CALLMONITOR_Attr($@) { delete($hash->{helper}{TEXTFILE}) if(defined($hash->{helper}{TEXTFILE})); } - - if($attrib eq "disable") - { - DevIo_OpenDev($hash, 0, undef); - } } return undef; @@ -1758,7 +1746,7 @@ sub FB_CALLMONITOR_normalizePhoneNumber($$)