ENIGMA2: add http-noshutdown attribute to change HttpUtils behaviour
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7404 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -81,7 +81,7 @@ sub ENIGMA2_Initialize($) {
|
|||||||
$hash->{UndefFn} = "ENIGMA2_Undefine";
|
$hash->{UndefFn} = "ENIGMA2_Undefine";
|
||||||
|
|
||||||
$hash->{AttrList} =
|
$hash->{AttrList} =
|
||||||
"https:0,1 http-method:GET,POST disable:0,1 bouquet-tv bouquet-radio timeout remotecontrol:standard,advanced,keyboard lightMode:0,1 "
|
"https:0,1 http-method:GET,POST http-noshutdown:1,0 disable:0,1 bouquet-tv bouquet-radio timeout remotecontrol:standard,advanced,keyboard lightMode:0,1 "
|
||||||
. $readingFnAttributes;
|
. $readingFnAttributes;
|
||||||
|
|
||||||
$data{RC_layout}{ENIGMA2_DreamMultimedia_DM500_DM800_SVG} =
|
$data{RC_layout}{ENIGMA2_DreamMultimedia_DM500_DM800_SVG} =
|
||||||
@@ -819,6 +819,7 @@ sub ENIGMA2_SendCommand($$;$$) {
|
|||||||
my $address = $hash->{helper}{ADDRESS};
|
my $address = $hash->{helper}{ADDRESS};
|
||||||
my $port = $hash->{helper}{PORT};
|
my $port = $hash->{helper}{PORT};
|
||||||
my $http_method = $attr{$name}{"http-method"};
|
my $http_method = $attr{$name}{"http-method"};
|
||||||
|
my $http_noshutdown = ( defined($attr{$name}{"http-noshutdown"}) && $attr{$name}{"http-noshutdown"} eq "0" ) ? 0 : 1;
|
||||||
my $timeout;
|
my $timeout;
|
||||||
$cmd = ( defined($cmd) ) ? $cmd : "";
|
$cmd = ( defined($cmd) ) ? $cmd : "";
|
||||||
|
|
||||||
@@ -888,13 +889,13 @@ sub ENIGMA2_SendCommand($$;$$) {
|
|||||||
|
|
||||||
# send request via HTTP-GET method
|
# send request via HTTP-GET method
|
||||||
if ( $http_method eq "GET" || $http_method eq "" || $cmd eq "" ) {
|
if ( $http_method eq "GET" || $http_method eq "" || $cmd eq "" ) {
|
||||||
Log3 $name, 5, "ENIGMA2 $name: GET " . urlDecode($URL);
|
Log3 $name, 5, "ENIGMA2 $name: GET " . urlDecode($URL) . " (noshutdown=" . $http_noshutdown . ")";
|
||||||
|
|
||||||
HttpUtils_NonblockingGet(
|
HttpUtils_NonblockingGet(
|
||||||
{
|
{
|
||||||
url => $URL,
|
url => $URL,
|
||||||
timeout => $timeout,
|
timeout => $timeout,
|
||||||
noshutdown => 1,
|
noshutdown => $http_noshutdown,
|
||||||
data => undef,
|
data => undef,
|
||||||
hash => $hash,
|
hash => $hash,
|
||||||
service => $service,
|
service => $service,
|
||||||
@@ -912,13 +913,13 @@ sub ENIGMA2_SendCommand($$;$$) {
|
|||||||
"ENIGMA2 $name: GET "
|
"ENIGMA2 $name: GET "
|
||||||
. $URL
|
. $URL
|
||||||
. " (POST DATA: "
|
. " (POST DATA: "
|
||||||
. urlDecode($cmd) . ")";
|
. urlDecode($cmd) . ", noshutdown=" . $http_noshutdown . ")";
|
||||||
|
|
||||||
HttpUtils_NonblockingGet(
|
HttpUtils_NonblockingGet(
|
||||||
{
|
{
|
||||||
url => $URL,
|
url => $URL,
|
||||||
timeout => $timeout,
|
timeout => $timeout,
|
||||||
noshutdown => 1,
|
noshutdown => $http_noshutdown,
|
||||||
data => $cmd,
|
data => $cmd,
|
||||||
hash => $hash,
|
hash => $hash,
|
||||||
service => $service,
|
service => $service,
|
||||||
@@ -3072,6 +3073,9 @@ sub ENIGMA2_GetRemotecontrolCommand($) {
|
|||||||
<li>
|
<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)
|
<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>
|
||||||
|
<li>
|
||||||
|
<b>http-noshutdown</b> - Set FHEM-internal HttpUtils connection close behaviour (defaults=1)
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b>https</b> - Access box via secure HTTP (true/false)
|
<b>https</b> - Access box via secure HTTP (true/false)
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user