FRITZBOX: password by rename

git-svn-id: https://svn.fhem.de/fhem/trunk@15456 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tupol
2017-11-19 13:40:50 +00:00
parent 019e7f4bdc
commit 54a98786b5

View File

@@ -175,6 +175,7 @@ sub FRITZBOX_Initialize($)
$hash->{DefFn} = "FRITZBOX_Define";
$hash->{UndefFn} = "FRITZBOX_Undefine";
$hash->{DeleteFn} = "FRITZBOX_Delete";
$hash->{RenameFn} = "FRITZBOX_Rename";
$hash->{SetFn} = "FRITZBOX_Set";
$hash->{GetFn} = "FRITZBOX_Get";
@@ -285,6 +286,20 @@ sub FRITZBOX_Delete ($$)
return undef;
}
#######################################################################
sub FRITZBOX_Rename($$)
{
my ($new, $old) = @_;
my $old_index = "FRITZBOX_".$old."_passwd";
my $new_index = "FRITZBOX_".$new."_passwd";
my ($err, $old_pwd) = getKeyValue($old_index);
setKeyValue($new_index, $old_pwd);
setKeyValue($old_index, undef);
}
#######################################################################
sub FRITZBOX_Attr($@)
{