fix room and remoteServer Attribut

This commit is contained in:
Marko Oldenburg 2017-12-13 21:03:23 +01:00
parent f8f74eabe1
commit 4ce293d0fc
2 changed files with 15 additions and 15 deletions

View File

@ -74,7 +74,7 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "4.1.99.1";
my $modulversion = "4.1.99.3";
my $flowsetversion = "4.0.11";
@ -153,7 +153,7 @@ sub AMADCommBridge_Define($$) {
$hash->{VERSIONFLOWSET} = $flowsetversion;
$attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) );
CommandAttr(undef,"$name room AMAD") if(AttrVal($name,'room','none') eq 'none');
Log3 $name, 3, "AMADCommBridge ($name) - defined AMADCommBridge with Socketport $port";

View File

@ -58,7 +58,7 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "4.1.99.1";
my $modulversion = "4.1.99.3";
my $flowsetversion = "4.0.11";
@ -139,19 +139,19 @@ sub AMADDevice_Define($$) {
my $iodev;
my $i = 0;
######## Kann in kommenden Versionen gelöscht werden ###############
#foreach my $param ( @a ) {
# if( $param =~ m/IODev=([^\s]*)/ ) {
foreach my $param ( @a ) {
if( $param =~ m/IODev=([^\s]*)/ ) {
# $iodev = $1;
# splice( @a, $i, 3 );
# last;
# }
$iodev = $1;
splice( @a, $i, 4 );
last;
}
# $i++;
#}
$i++;
}
return "too few parameters: define <name> AMADDevice <HOST-IP> <amad_id> <remoteServer>" if( @a != 4 );
return "too few parameters: define <name> AMADDevice <HOST-IP> <amad_id> <remoteServer>" if( @a != 5 );
return "Cannot define a AMAD device. Perl modul $missingModul is missing." if ( $missingModul );
@ -194,8 +194,8 @@ sub AMADDevice_Define($$) {
CommandAttr(undef,$name . "room AMAD") if(AttrVal($name,'room','none') eq 'none';
CommandAttr(undef,$name . "remoteServer $remoteServer") if(AttrVal($name,'remoteServer','none') eq 'none';
CommandAttr(undef,"$name room AMAD") if(AttrVal($name,'room','none') eq 'none');
CommandAttr(undef,"$name remoteServer $remoteServer") if(AttrVal($name,'remoteServer','none') eq 'none');
readingsBeginUpdate($hash);
readingsBulkUpdateIfChanged( $hash, "state", "initialized",1);