harmonizing according to Yamaha interface description
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2135 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -551,14 +551,36 @@ sub YAMAHA_AVR_getModel($$)
|
|||||||
{
|
{
|
||||||
my ($hash, $address) = @_;
|
my ($hash, $address) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $response = GetFileFromURL("http://".$address."/YamahaRemoteControl/desc.xml");
|
my $response;
|
||||||
return undef unless(defined($response));
|
my $desc_url;
|
||||||
if($response =~ /<Unit_Description\s+Version="(.+?)"\s+Unit_Name="(.+?)">/)
|
|
||||||
{
|
$response = YAMAHA_AVR_SendCommand($address, "<YAMAHA_AV cmd=\"GET\"><System><Unit_Desc>GetParam</Unit_Desc></System></YAMAHA_AV>");
|
||||||
$hash->{FIRMWARE} = $1;
|
|
||||||
$hash->{MODEL} = $2;
|
|
||||||
|
if(defined($response) and $response =~ /<URL>(.+?)<\/URL>/)
|
||||||
|
{
|
||||||
|
$desc_url = $1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$desc_url = "/YamahaRemoteControl/desc.xml";
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = YAMAHA_AVR_SendCommand($address, "<YAMAHA_AV cmd=\"GET\"><System><Config>GetParam</Config></System></YAMAHA_AV>");
|
||||||
|
|
||||||
|
if(defined($response) and $response =~ /<Model_Name>(.+?)<\/Model_Name>.*<System_ID>(.+?)<\/System_ID>.*<Version>(.+?)<\/Version>/)
|
||||||
|
{
|
||||||
|
$hash->{MODEL} = $1;
|
||||||
|
$hash->{SYSTEM_ID} = $2;
|
||||||
|
$hash->{FIRMWARE} = $3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = GetFileFromURL("http://".$address.$desc_url);
|
||||||
|
return undef unless(defined($response));
|
||||||
|
|
||||||
while($response =~ /<Menu Func="Subunit" Title_1="(.+?)" YNC_Tag="(.+?)">/gc)
|
while($response =~ /<Menu Func="Subunit" Title_1="(.+?)" YNC_Tag="(.+?)">/gc)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user