stability improvements

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@2104 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch
2012-11-09 20:46:43 +00:00
parent ae70b50cd4
commit 2e79b0e7d2

View File

@@ -442,6 +442,7 @@ sub getModel($$)
{ {
my ($hash, $address) = @_; my ($hash, $address) = @_;
my $response = GetFileFromURL("http://".$address."/YamahaRemoteControl/desc.xml"); my $response = GetFileFromURL("http://".$address."/YamahaRemoteControl/desc.xml");
return undef unless(defined($response));
if($response =~ /<Unit_Description.* Unit_Name="(.+?)">/) if($response =~ /<Unit_Description.* Unit_Name="(.+?)">/)
{ {
$hash->{MODEL} = $1; $hash->{MODEL} = $1;
@@ -453,6 +454,7 @@ sub getInputs($$)
my ($hash, $address) = @_; my ($hash, $address) = @_;
my $response = SendCommand($address, "<YAMAHA_AV cmd=\"GET\"><Main_Zone><Input><Input_Sel_Item>GetParam</Input_Sel_Item></Input></Main_Zone></YAMAHA_AV>"); my $response = SendCommand($address, "<YAMAHA_AV cmd=\"GET\"><Main_Zone><Input><Input_Sel_Item>GetParam</Input_Sel_Item></Input></Main_Zone></YAMAHA_AV>");
return undef unless (defined($response));
$response =~ s/></>\n</g; $response =~ s/></>\n</g;
my @inputs = split("\n", $response); my @inputs = split("\n", $response);