mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
FB_CALLMONITOR: read phonebooks after all attributes are set from fhem.cfg. (Forum: #30244)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@7647 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c4b7b49376
commit
0c16ca6ec5
2
CHANGED
2
CHANGED
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: FB_CALLMONITOR: read phonebooks after all attributes are set
|
||||||
|
from fhem.cfg.
|
||||||
- feature: 70_XBMC.pm: clear readings when stopping media
|
- feature: 70_XBMC.pm: clear readings when stopping media
|
||||||
- feature: 70_XBMC.pm: new reading is3DFile for 3D files
|
- feature: 70_XBMC.pm: new reading is3DFile for 3D files
|
||||||
- bugfix: 70_XBMC.pm: improved JSON separator
|
- bugfix: 70_XBMC.pm: improved JSON separator
|
||||||
|
@ -88,7 +88,9 @@ FB_CALLMONITOR_Initialize($)
|
|||||||
$hash->{DefFn} = "FB_CALLMONITOR_Define";
|
$hash->{DefFn} = "FB_CALLMONITOR_Define";
|
||||||
$hash->{UndefFn} = "FB_CALLMONITOR_Undef";
|
$hash->{UndefFn} = "FB_CALLMONITOR_Undef";
|
||||||
$hash->{AttrFn} = "FB_CALLMONITOR_Attr";
|
$hash->{AttrFn} = "FB_CALLMONITOR_Attr";
|
||||||
$hash->{AttrList}= "do_not_notify:0,1 disable:0,1 unique-call-ids:0,1 local-area-code remove-leading-zero:0,1 reverse-search-cache-file reverse-search:multiple-strict,phonebook,klicktel.de,dasoertliche.de,search.ch,dasschnelle.at reverse-search-cache:0,1 reverse-search-phonebook-file fritzbox-remote-phonebook:0,1 fritzbox-user ".
|
$hash->{NotifyFn} = "FB_CALLMONITOR_Notify";
|
||||||
|
$hash->{NOTIFYDEV} = "global";
|
||||||
|
$hash->{AttrList} = "do_not_notify:0,1 disable:0,1 unique-call-ids:0,1 local-area-code remove-leading-zero:0,1 reverse-search-cache-file reverse-search:multiple-strict,phonebook,klicktel.de,dasoertliche.de,search.ch,dasschnelle.at reverse-search-cache:0,1 reverse-search-phonebook-file fritzbox-remote-phonebook:0,1 fritzbox-user ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +336,8 @@ FB_CALLMONITOR_Attr($@)
|
|||||||
|
|
||||||
if($cmd eq "set")
|
if($cmd eq "set")
|
||||||
{
|
{
|
||||||
if(($attrib eq "reverse-search" and $value =~ /(all|internal|phonebook)/) or $attrib eq "reverse-search-phonebook-file" or $attrib eq "fritzbox-remote-phonebook")
|
|
||||||
|
if((($attrib eq "reverse-search" and $value =~ /(all|internal|phonebook)/) or $attrib eq "reverse-search-phonebook-file" or $attrib eq "fritzbox-remote-phonebook") and $init_done == 1)
|
||||||
{
|
{
|
||||||
$attr{$name}{$attrib} = $value;
|
$attr{$name}{$attrib} = $value;
|
||||||
return FB_CALLMONITOR_readPhonebook($hash);
|
return FB_CALLMONITOR_readPhonebook($hash);
|
||||||
@ -380,6 +383,17 @@ FB_CALLMONITOR_Attr($@)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub
|
||||||
|
FB_CALLMONITOR_Notify($$)
|
||||||
|
{
|
||||||
|
my ($hash,$dev) = @_;
|
||||||
|
|
||||||
|
return if($dev->{NAME} ne "global");
|
||||||
|
return if(!grep(m/^INITIALIZED|REREADCFG$/, @{$dev->{CHANGED}}));
|
||||||
|
|
||||||
|
FB_CALLMONITOR_readPhonebook($hash);
|
||||||
|
}
|
||||||
############################################################################################################
|
############################################################################################################
|
||||||
#
|
#
|
||||||
# Begin of helper functions
|
# Begin of helper functions
|
||||||
@ -640,7 +654,6 @@ sub FB_CALLMONITOR_readPhonebook($;$$)
|
|||||||
|
|
||||||
if(AttrVal($name, "fritzbox-remote-phonebook", "0") eq "1")
|
if(AttrVal($name, "fritzbox-remote-phonebook", "0") eq "1")
|
||||||
{
|
{
|
||||||
|
|
||||||
($err, $phonebook) = FB_CALLMONITOR_readRemotePhonebook($hash);
|
($err, $phonebook) = FB_CALLMONITOR_readRemotePhonebook($hash);
|
||||||
|
|
||||||
if(defined($err))
|
if(defined($err))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user