Verbesserte Fehlerbehandlung bei der Define Syntax und bei nicht initialisierten Variablen

This commit is contained in:
Marko Oldenburg 2016-03-11 14:11:18 +01:00
parent b6ffa1d6b3
commit 5ed1b77f30
2 changed files with 9 additions and 3 deletions

View File

@ -37,7 +37,7 @@ use TcpServerUtils;
use Encode qw(encode);
my $version = "1.9.39";
my $version = "1.9.41";
@ -224,7 +224,7 @@ my ( $hash ) = @_;
RemoveInternalTimer( $hash );
if( $init_done && ReadingsVal( $name, "deviceState", "online" ) eq "online" && AttrVal( $name, "disable", 0 ) ne "1" && ReadingsVal( $bname, "fhemServerIP", "not set" ) ne "not set" ) {
if( $init_done && ReadingsVal( $name, "deviceState", "online" ) eq "online" && AttrVal( $name, "disable", 0 ) ne "1" && ReadingsVal( $bname, "fhemServerIP", "not set" ) ne "not set" && $hash->{APSSID} ) {
AMAD_statusRequest( $hash );
@ -232,6 +232,7 @@ my ( $hash ) = @_;
Log3 $name, 3, "AMAD ($name) - GetUpdate, FHEM or Device not ready yet";
Log3 $name, 3, "AMAD ($name) - GetUpdate, Please set $bname fhemServerIP <IP-FHEM> NOW!" if( ReadingsVal( $bname, "fhemServerIP", "none" ) eq "none" );
Log3 $name, 3, "AMAD ($name) - Attention!!! Your Device was defined without ACCESSPOINT-SSID, please modify the DEF to <HOST-IP> <ACCESSPOINT-SSID>" if( ! $hash->{APSSID} );
InternalTimer( gettimeofday()+15, "AMAD_GetUpdate", $hash, 0 );
}
@ -774,6 +775,10 @@ sub AMAD_SelectSetCmd($$@) {
my $intentstring = join( " ", @data );
my ( $action, $exkey1, $exval1, $exkey2, $exval2 ) = split( "[ \t][ \t]*", $intentstring );
$exkey1 = "" if( !$exkey1 );
$exval1 = "" if( !$exval1 );
$exkey2 = "" if( !$exkey2 );
$exval2 = "" if( !$exval2 );
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/sendIntent?action=".$action."&exkey1=".$exkey1."&exval1=".$exval1."&exkey2=".$exkey2."&exval2=".$exval2;

View File

@ -1,5 +1,6 @@
<h3>AMAD2 Beta Version 1.9.x</h3>
<ul>
<u><b>AMAD - Automagic Android Device</b></u>
<br> Diese Version ist Beta und nur für Tester geeignet!
<br> Diese Version ist noch Beta aber schon recht stabil!
<br> Ist die neue define Syntax noch nicht angepasst, sollten nun keine Devices mehr gelöscht werden, sondern man bekommt einen Hinweis im Log
</ul>