YAMAHA_AVR: fix return of next scheduled timestamp for statusRequest

git-svn-id: https://svn.fhem.de/fhem/trunk@6517 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2014-09-07 17:05:19 +00:00
parent 48d922626c
commit 1017a5cce6

View File

@ -115,7 +115,6 @@ YAMAHA_AVR_Get($@)
if(exists($hash->{READINGS}{$what})) if(exists($hash->{READINGS}{$what}))
{ {
if(defined($hash->{READINGS}{$what})) if(defined($hash->{READINGS}{$what}))
{ {
return $hash->{READINGS}{$what}{VAL}; return $hash->{READINGS}{$what}{VAL};
@ -631,10 +630,8 @@ YAMAHA_AVR_Define($$)
{ {
if(defined(YAMAHA_AVR_getParamName($hash, lc $hash->{helper}{SELECTED_ZONE}, $hash->{helper}{ZONES}))) if(defined(YAMAHA_AVR_getParamName($hash, lc $hash->{helper}{SELECTED_ZONE}, $hash->{helper}{ZONES})))
{ {
$hash->{ACTIVE_ZONE} = lc $hash->{helper}{SELECTED_ZONE}; $hash->{ACTIVE_ZONE} = lc $hash->{helper}{SELECTED_ZONE};
YAMAHA_AVR_getInputs($hash); YAMAHA_AVR_getInputs($hash);
} }
else else
{ {
@ -736,7 +733,6 @@ YAMAHA_AVR_SendCommand($@)
if($blocking == 1) if($blocking == 1)
{ {
Log3 $name, 5, "YAMAHA_AVR ($name) - execute blocking \"$cmd".(defined($arg) ? " ".(split("\\|", $arg))[0] : "")."\" on $name: $data"; Log3 $name, 5, "YAMAHA_AVR ($name) - execute blocking \"$cmd".(defined($arg) ? " ".(split("\\|", $arg))[0] : "")."\" on $name: $data";
my $param = { my $param = {
url => "http://".$address."/YamahaRemoteControl/ctrl", url => "http://".$address."/YamahaRemoteControl/ctrl",
@ -750,8 +746,7 @@ YAMAHA_AVR_SendCommand($@)
}; };
my ($err, $data) = HttpUtils_BlockingGet($param); my ($err, $data) = HttpUtils_BlockingGet($param);
return YAMAHA_AVR_ParseResponse($param, $err, $data); YAMAHA_AVR_ParseResponse($param, $err, $data);
} }
else else
{ {
@ -777,7 +772,6 @@ YAMAHA_AVR_SendCommand($@)
sub sub
YAMAHA_AVR_ParseResponse ($$$) YAMAHA_AVR_ParseResponse ($$$)
{ {
my ( $param, $err, $data ) = @_; my ( $param, $err, $data ) = @_;
my $hash = $param->{hash}; my $hash = $param->{hash};
@ -1247,16 +1241,16 @@ YAMAHA_AVR_ParseXML($$$)
} }
Log3 $name, 4, "YAMAHA_AVR ($name) - adding zone: $2"; Log3 $name, 4, "YAMAHA_AVR ($name) - adding zone: $2";
$hash->{helper}{ZONES} .= $2; $hash->{helper}{ZONES} .= $2;
} }
delete( $hash->{helper}{DSP_MODES}) if(exists($hash->{helper}{DSP_MODES})); delete( $hash->{helper}{DSP_MODES}) if(exists($hash->{helper}{DSP_MODES}));
if($data =~ /<Menu Func_Ex="Surround" Title_1="Surround">.*?<Get>(.+?)<\/Get>/) if($data =~ /<Menu Func_Ex="Surround" Title_1="Surround">.*?<Get>(.+?)<\/Get>/)
{ {
my $modes = $1; my $modes = $1;
Log3 $name, 4, "YAMAHA_AVR ($name) - found DSP modes in XML"; Log3 $name, 4, "YAMAHA_AVR ($name) - found DSP modes in XML";
while($modes =~ /<Direct.*?>(.+?)<\/Direct>/gc) while($modes =~ /<Direct.*?>(.+?)<\/Direct>/gc)
{ {
if(defined($hash->{helper}{DSP_MODES}) and length($hash->{helper}{DSP_MODES}) > 0) if(defined($hash->{helper}{DSP_MODES}) and length($hash->{helper}{DSP_MODES}) > 0)
@ -1265,7 +1259,6 @@ YAMAHA_AVR_ParseXML($$$)
} }
Log3 $name, 4, "YAMAHA_AVR ($name) - adding DSP mode $1"; Log3 $name, 4, "YAMAHA_AVR ($name) - adding DSP mode $1";
$hash->{helper}{DSP_MODES} .= $1; $hash->{helper}{DSP_MODES} .= $1;
} }
} }
else else
@ -1290,7 +1283,6 @@ YAMAHA_AVR_ParseXML($$$)
Log3 $name, 2, "YAMAHA_AVR ($name) - selected zone >>".$hash->{helper}{SELECTED_ZONE}."<< is not available. Using Main Zone instead"; Log3 $name, 2, "YAMAHA_AVR ($name) - selected zone >>".$hash->{helper}{SELECTED_ZONE}."<< is not available. Using Main Zone instead";
$hash->{ACTIVE_ZONE} = "mainzone"; $hash->{ACTIVE_ZONE} = "mainzone";
} }
} }
############################# #############################
@ -1317,7 +1309,6 @@ sub YAMAHA_AVR_volume_abs2rel($)
# queries all available inputs and scenes # queries all available inputs and scenes
sub YAMAHA_AVR_getInputs($) sub YAMAHA_AVR_getInputs($)
{ {
my ($hash) = @_; my ($hash) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $address = $hash->{helper}{ADDRESS}; my $address = $hash->{helper}{ADDRESS};
@ -1356,6 +1347,8 @@ sub YAMAHA_AVR_ResetTimer($;$)
InternalTimer(gettimeofday()+$hash->{helper}{OFF_INTERVAL}, "YAMAHA_AVR_GetStatus", $hash, 0); InternalTimer(gettimeofday()+$hash->{helper}{OFF_INTERVAL}, "YAMAHA_AVR_GetStatus", $hash, 0);
} }
} }
return undef;
} }
############################# #############################