From 7d01c2908e17e39bfaf50cfe5d87ed2df4e4e601 Mon Sep 17 00:00:00 2001 From: jowiemann <> Date: Mon, 20 Nov 2023 08:34:12 +0000 Subject: [PATCH] =?UTF-8?q?72=5FFRITZBOX.pm:=20bugfix=20set=20=20loc?= =?UTF-8?q?kLandevice=20f=C3=BCr=20FritzOS=20>=3D=207.50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.fhem.de/fhem/trunk@28189 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/72_FRITZBOX.pm | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/fhem/FHEM/72_FRITZBOX.pm b/fhem/FHEM/72_FRITZBOX.pm index 94446541f..84ab11be7 100644 --- a/fhem/FHEM/72_FRITZBOX.pm +++ b/fhem/FHEM/72_FRITZBOX.pm @@ -41,7 +41,7 @@ use warnings; use Blocking; use HttpUtils; -my $ModulVersion = "07.50.21"; +my $ModulVersion = "07.57.00"; my $missingModul = ""; my $FRITZBOX_TR064pwd; my $FRITZBOX_TR064user; @@ -1451,7 +1451,7 @@ sub FRITZBOX_Set($$@) if (int @val == 2) { - $val[0] = FRITZBOX_Proof_Params($hash, $name, $cmd, "^(on|off)\$", @val); + $val[0] = FRITZBOX_Proof_Params($hash, $name, $cmd, "^(on|off|rt)\$", @val); return $val[0] if($val[0] =~ /ERROR/); @@ -5941,10 +5941,6 @@ sub FRITZBOX_Run_lockLandevice($) my $returnStr; push @webCmdArray, "xhr" => "1"; -# if ($val[1] eq "on") { -# push @webCmdArray, "kisi_profile" => "filtprof1"; -# } - push @webCmdArray, "dev" => $val[0]; push @webCmdArray, "lang" => "de"; @@ -5965,6 +5961,8 @@ sub FRITZBOX_Run_lockLandevice($) } else { if($val[1] eq "on") { push @webCmdArray, "internetdetail" => "blocked"; + } elsif($val[1] eq "rt") { + push @webCmdArray, "internetdetail" => "realtime"; } else { push @webCmdArray, "internetdetail" => "unlimited"; } @@ -5973,11 +5971,13 @@ sub FRITZBOX_Run_lockLandevice($) push @webCmdArray, "dev_name" => "$dev_name"; } - FRITZBOX_Log $hash, 5, "get $name $cmd " . join(" ", @webCmdArray); - my $lock_res = FRITZBOX_Lan_Device_Info( $hash, $val[0], "lockLandevice"); - unless (($lock_res =~ /blocked/ && $val[1] eq "on") || ($lock_res =~ /unlimited/ && $val[1] eq "off")) { + # FRITZBOX_Log $hash, 3, "Lan_Device_Info $name $cmd " . $lock_res; + + unless (($lock_res =~ /blocked/ && $val[1] eq "on") || ($lock_res =~ /unlimited|limited/ && $val[1] eq "off") || ($lock_res =~ /realtime/ && $val[1] eq "rt")) { + + FRITZBOX_Log $hash, 5, "get $name $cmd " . join(" ", @webCmdArray); my $result = FRITZBOX_Function_Lua($hash, "data", \@webCmdArray); @@ -5987,13 +5987,14 @@ sub FRITZBOX_Run_lockLandevice($) } else { $lock_res = FRITZBOX_Lan_Device_Info( $hash, $val[0], "lockLandevice"); + # FRITZBOX_Log $hash, 3, "Lan_Device_Info $name $cmd " . $lock_res; if ($lock_res =~ /ERROR/) { FRITZBOX_Log $hash, 2, "setting locklandevice: " . substr($lock_res, 7); FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "retStat_lockLandevice", $val[0] . "->ERROR:" . substr($lock_res, 7); } else { - unless (($lock_res =~ /blocked/ && $val[1] eq "on") || ($lock_res =~ /unlimited/ && $val[1] eq "off")) { + unless (($lock_res =~ /blocked/ && $val[1] eq "on") || ($lock_res =~ /unlimited|limited/ && $val[1] eq "off") || ($lock_res =~ /realtime/ && $val[1] eq "rt")) { FRITZBOX_Log $hash, 2, "setting locklandevice: " . $val[0]; FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "retStat_lockLandevice", $val[0] . "->ERROR: setting locklandevice " . $val[1]; } else { @@ -6004,7 +6005,7 @@ sub FRITZBOX_Run_lockLandevice($) } } else { FRITZBOX_Log $hash, 4, "" . $lock_res . " -> $name $cmd $val[1]"; - FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "retStat_lockLandevice", $val[0] . "->" . $val[1]; + FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "retStat_lockLandevice", $val[0] . " locked is " . $val[1]; } FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "fhem->sid", $result->{sid} if $result->{sid}; @@ -8547,10 +8548,10 @@ sub FRITZBOX_readPassword($)
  • -
    set <name> lockLandevice <number> <on|off>
    +
    set <name> lockLandevice <number> <on|off|rt>

    <number> is the ID from landevicen..n or its MAC
    - Switches the landevice on or off.
    + Switches the landevice blocking to on (blocked), off (unlimited) or to rt (realtime).
    Execution is non-blocking. The feedback takes place in the reading: retStat_lockLandevice
    Needs FRITZ!OS 7.21 or higher

  • @@ -9332,10 +9333,10 @@ sub FRITZBOX_readPassword($)
  • -
    set <name> lockLandevice <number> <on|off>
    +
    set <name> lockLandevice <number> <on|off|rt>

    <number> ist die ID des landevicen..n oder dessen MAC.
    - Schaltet das Netzgerät an oder aus.
    + Schaltet das Blockieren des Netzgerät on(blocked), off(unlimited) oder rt(realtime).
    Die Ausführung erfolgt non Blocking. Die Rückmeldung erfolgt im Reading: retStat_lockLandevice
    Benötigt FRITZ!OS 7.21 oder höher.