add 99_myUtils sub calls
This commit is contained in:
parent
f3e496e417
commit
6659d27788
@ -70,8 +70,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
|
|||||||
eval "use JSON;1" or $missingModul .= "JSON ";
|
eval "use JSON;1" or $missingModul .= "JSON ";
|
||||||
|
|
||||||
|
|
||||||
my $modulversion = "4.0.0";
|
my $modulversion = "4.0.1";
|
||||||
my $flowsetversion = "4.0.0";
|
my $flowsetversion = "4.0.1";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -114,6 +114,7 @@ sub AMADCommBridge_Initialize($) {
|
|||||||
$hash->{AttrFn} = "AMADCommBridge_Attr";
|
$hash->{AttrFn} = "AMADCommBridge_Attr";
|
||||||
$hash->{AttrList} = "fhemControlMode:trigger,setControl,thirdPartControl ".
|
$hash->{AttrList} = "fhemControlMode:trigger,setControl,thirdPartControl ".
|
||||||
"debugJSON:0,1 ".
|
"debugJSON:0,1 ".
|
||||||
|
"enableSubCalls:0,1 ".
|
||||||
"disable:1 ".
|
"disable:1 ".
|
||||||
"allowFrom ".
|
"allowFrom ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
@ -266,7 +267,6 @@ sub AMADCommBridge_ErrorHandling($$$) {
|
|||||||
my ($param,$err,$data) = @_;
|
my ($param,$err,$data) = @_;
|
||||||
|
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
#my $name = $hash->{NAME};
|
|
||||||
my $dhash = $modules{AMADDevice}{defptr}{$param->{'amad_id'}};
|
my $dhash = $modules{AMADDevice}{defptr}{$param->{'amad_id'}};
|
||||||
my $dname = $dhash->{NAME};
|
my $dname = $dhash->{NAME};
|
||||||
|
|
||||||
@ -804,10 +804,11 @@ sub AMADCommBridge_ResponseProcessing($$) {
|
|||||||
my $fhemCmd = $decode_json->{payload}{setcmd};
|
my $fhemCmd = $decode_json->{payload}{setcmd};
|
||||||
|
|
||||||
fhem ("set $fhemCmd") if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'setControl' );
|
fhem ("set $fhemCmd") if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'setControl' );
|
||||||
readingsSingleUpdate( $bhash, "receiveFhemCommand", "set ".$fhemCmd, 1 ) if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'trigger' );;
|
my $r = AnalyzeCommandChain($bhash, 'set'.$fhemCmd);
|
||||||
|
readingsSingleUpdate( $bhash, "receiveFhemCommand", "set ".$fhemCmd, 1 ) if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'trigger' );
|
||||||
Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: set reading receive fhem command";
|
Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: set reading receive fhem command";
|
||||||
|
|
||||||
$response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM execute set command now\r\n";
|
$response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM response $r\r\n";
|
||||||
$c = $hash->{CD};
|
$c = $hash->{CD};
|
||||||
print $c "HTTP/1.1 200 OK\r\n",
|
print $c "HTTP/1.1 200 OK\r\n",
|
||||||
"Content-Type: text/plain\r\n",
|
"Content-Type: text/plain\r\n",
|
||||||
@ -853,33 +854,33 @@ sub AMADCommBridge_ResponseProcessing($$) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elsif ( $fhemcmd eq 'fhemfunc' ) {
|
||||||
|
my $fhemCmd = $decode_json->{payload}{fhemsub};
|
||||||
|
|
||||||
# elsif ( $fhemcmd =~ /fhemfunc\b/ ) {
|
Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: receive fhem-function command";
|
||||||
# my $fhemCmd = $data[1];
|
|
||||||
#
|
|
||||||
# Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: receive fhem-function command";
|
|
||||||
#
|
|
||||||
# if( $fhemCmd =~ /^{.*}$/ ) {
|
|
||||||
#
|
|
||||||
# $response = $fhemCmd if( ReadingsVal( $name, "expertMode", 0 ) eq "1" );
|
|
||||||
#
|
|
||||||
# } else {
|
|
||||||
#
|
|
||||||
# $response = "header lines: \r\n AMADCommBridge receive no typical FHEM function\r\n FHEM to do nothing\r\n";
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# $c = $hash->{CD};
|
|
||||||
# print $c "HTTP/1.1 200 OK\r\n",
|
|
||||||
# "Content-Type: text/plain\r\n",
|
|
||||||
# "Connection: close\r\n",
|
|
||||||
# "Content-Length: ".length($response)."\r\n\r\n",
|
|
||||||
# $response;
|
|
||||||
#
|
|
||||||
# return;
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
if( AttrVal( $bname, 'enableSubCalls', 0 ) == 1 ) {
|
||||||
|
|
||||||
|
$response = AnalyzeCommand($bhash, '{'.$fhemCmd.'}');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$response = "header lines: \r\n Attribut enableSubCalls is not set or value is 0\r\n FHEM to do nothing\r\n";
|
||||||
|
Log3 $bname, 3, "AMADCommBridge ($name) - Attribut enableSubCalls is not set or value is 0, FHEM to do nothing";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$c = $hash->{CD};
|
||||||
|
print $c "HTTP/1.1 200 OK\r\n",
|
||||||
|
"Content-Type: text/plain\r\n",
|
||||||
|
"Connection: close\r\n",
|
||||||
|
"Content-Length: ".length($response)."\r\n\r\n",
|
||||||
|
$response;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response = "header lines: \r\n AMADCommBridge receive incomplete or corrupt Data\r\n FHEM to do nothing\r\n";
|
$response = "header lines: \r\n AMADCommBridge receive incomplete or corrupt Data\r\n FHEM to do nothing\r\n";
|
||||||
$c = $hash->{CD};
|
$c = $hash->{CD};
|
||||||
|
@ -55,7 +55,7 @@ eval "use JSON;1" or $missingModul .= "JSON ";
|
|||||||
|
|
||||||
|
|
||||||
my $modulversion = "4.0.3";
|
my $modulversion = "4.0.3";
|
||||||
my $flowsetversion = "4.0.0";
|
my $flowsetversion = "4.0.1";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user