2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

Revert "ENIGMA2: set noshutdown=0 on Fritzbox devices and add attribut http-noshutdown"

This reverts commit f98a0022c7fb9385d7eef5551011450dafb47166.

git-svn-id: https://svn.fhem.de/fhem/trunk@5132 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2014-03-04 20:49:52 +00:00
parent 058e14f2b1
commit 1c1ce28956
2 changed files with 17 additions and 27 deletions

View File

@ -1,8 +1,6 @@
# 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.
- SVN
- bugfix: ENIGMA2: set noshutdown=0 on Fritzbox devices and add attribut
http-noshutdown for control
- feature: JSONMETER: added statistic functions
- feature: LightScene: added scene editor from UliM
- feature: SYSMON: New method: SYSMON_ShowValuesText

View File

@ -24,7 +24,7 @@
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
#
#
# Version: 1.3.3
# Version: 1.3.2
#
# Major Version History:
# - 1.3.0 - 2013-12-21
@ -78,7 +78,7 @@ sub ENIGMA2_Initialize($) {
$hash->{UndefFn} = "ENIGMA2_Undefine";
$hash->{AttrList} =
"https:0,1 http-method:GET,POST http-noshutdown:1,0 disable:0,1 bouquet-tv bouquet-radio timeout "
"https:0,1 http-method:GET,POST disable:0,1 bouquet-tv bouquet-radio timeout "
. $readingFnAttributes;
$data{RC_layout}{ENIGMA2_DreamMultimedia_DM500_DM800_SVG} =
@ -769,14 +769,11 @@ sub ENIGMA2_Define($$) {
{
$attr{$name}{"http-method"} = 'POST';
}
}
unless ( defined( AttrVal( $name, "http-noshutdown", undef ) ) ) {
# do shutdown in case this is a FritzBox
if ( exists $ENV{CONFIG_PRODUKT_NAME}
&& defined $ENV{CONFIG_PRODUKT_NAME} )
{
$attr{$name}{"http-noshutdown"} = '0';
# default method is GET and should be compatible to most
# ENIGMA2 Webif versions
else {
$attr{$name}{"http-method"} = 'GET';
}
}
unless ( defined( AttrVal( $name, "webCmd", undef ) ) ) {
@ -809,8 +806,7 @@ sub ENIGMA2_SendCommand($$;$$) {
my $name = $hash->{NAME};
my $address = $hash->{helper}{ADDRESS};
my $port = $hash->{helper}{PORT};
my $http_method =
( $attr{$name}{"http-method"} ) ? $attr{$name}{"http-method"} : "GET";
my $http_method = $attr{$name}{"http-method"};
my $timeout;
$cmd = ( defined($cmd) ) ? $cmd : "";
@ -875,23 +871,20 @@ sub ENIGMA2_SendCommand($$;$$) {
$timeout = $attr{$name}{timeout};
}
else {
$timeout = 3;
$timeout = 6;
}
my $noshutdown =
( $attr{$name}{"http-noshutdown"} )
? $attr{$name}{"http-noshutdown"}
: 1;
# send request via HTTP-GET method
if ( $http_method eq "GET" || $http_method eq "" || $cmd eq "" ) {
Log3 $name, 5, "ENIGMA2 $name: GET " . urlDecode($URL);
# $response = GetFileFromURL( $URL, $timeout, undef, 0, 5 );
HttpUtils_NonblockingGet(
{
url => $URL,
timeout => $timeout,
noshutdown => $noshutdown,
noshutdown => 1,
data => undef,
hash => $hash,
service => $service,
@ -911,11 +904,13 @@ sub ENIGMA2_SendCommand($$;$$) {
. " (POST DATA: "
. urlDecode($cmd) . ")";
# $response = GetFileFromURL( $URL, $timeout, $cmd, 0, 5 );
HttpUtils_NonblockingGet(
{
url => $URL,
timeout => $timeout,
noshutdown => $noshutdown,
noshutdown => 1,
data => $cmd,
hash => $hash,
service => $service,
@ -2758,9 +2753,6 @@ sub ENIGMA2_GetRemotecontrolCommand($) {
<li>
<b>http-method</b> - HTTP access method to be used; e.g. a FritzBox might need to use POST instead of GET (GET/POST)
</li>
<li>
<b>http-noshutdown</b> - Explicitly shutdown HTTP connections or not; e.g. a FritzBox might this to be 0 (default=1)
</li>
<li>
<b>https</b> - Access box via secure HTTP (true/false)
</li>