2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

FB_CALLLIST: add RenameFn

git-svn-id: https://svn.fhem.de/fhem/trunk@10645 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2016-01-27 18:19:47 +00:00
parent 007e5e29f2
commit eae7c220f6

View File

@ -40,6 +40,7 @@ FB_CALLLIST_Initialize($)
$hash->{SetFn} = "FB_CALLLIST_Set";
$hash->{DefFn} = "FB_CALLLIST_Define";
$hash->{NotifyFn} = "FB_CALLLIST_Notify";
$hash->{RenameFn} = "FB_CALLLIST_Rename";
$hash->{DeleteFn} = "FB_CALLLIST_Delete";
$hash->{AttrFn} = "FB_CALLLIST_Attr";
$hash->{AttrList} = "number-of-calls:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ".
@ -256,6 +257,18 @@ sub FB_CALLLIST_Delete($)
Log3 $name, 3, "FB_CALLLIST ($name) - error while deleting the current call list: $err" if(defined($err));
}
#####################################
# If Device is rename, copy the current data
sub FB_CALLLIST_Rename($$)
{
my ($new,$old) = @_;
setKeyValue("FB_CALLLIST-".$new, getKeyValue("FB_CALLLIST-".$old));
setKeyValue("FB_CALLLIST-".$old, undef);
return undef;
}
#####################################
# NotifyFn is trigger upon changes on FB_CALLMONITOR device. Imports the call data into call list
sub FB_CALLLIST_Notify($$)