mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
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:
parent
48d922626c
commit
1017a5cce6
@ -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};
|
||||||
@ -489,7 +488,7 @@ YAMAHA_AVR_Set($@)
|
|||||||
}
|
}
|
||||||
elsif($a[2] eq "30min")
|
elsif($a[2] eq "30min")
|
||||||
{
|
{
|
||||||
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Power_Control><Sleep>30 min</Sleep></Power_Control></$zone></YAMAHA_AV>", $what, $a[2]);
|
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Power_Control><Sleep>30 min</Sleep></Power_Control></$zone></YAMAHA_AV>", $what, $a[2]);
|
||||||
}
|
}
|
||||||
elsif($a[2] eq "60min")
|
elsif($a[2] eq "60min")
|
||||||
{
|
{
|
||||||
@ -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
|
||||||
{
|
{
|
||||||
@ -659,7 +656,7 @@ YAMAHA_AVR_Define($$)
|
|||||||
$hash->{helper}{DISABLED} = 0 unless(exists($hash->{helper}{DISABLED}));
|
$hash->{helper}{DISABLED} = 0 unless(exists($hash->{helper}{DISABLED}));
|
||||||
YAMAHA_AVR_ResetTimer($hash,0);
|
YAMAHA_AVR_ResetTimer($hash,0);
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -674,8 +671,8 @@ YAMAHA_AVR_Attr(@)
|
|||||||
{
|
{
|
||||||
if($a[3] eq "0")
|
if($a[3] eq "0")
|
||||||
{
|
{
|
||||||
$hash->{helper}{DISABLED} = 0;
|
$hash->{helper}{DISABLED} = 0;
|
||||||
YAMAHA_AVR_GetStatus($hash, 1);
|
YAMAHA_AVR_GetStatus($hash, 1);
|
||||||
}
|
}
|
||||||
elsif($a[3] eq "1")
|
elsif($a[3] eq "1")
|
||||||
{
|
{
|
||||||
@ -698,11 +695,11 @@ YAMAHA_AVR_Attr(@)
|
|||||||
sub
|
sub
|
||||||
YAMAHA_AVR_Undefine($$)
|
YAMAHA_AVR_Undefine($$)
|
||||||
{
|
{
|
||||||
my($hash, $name) = @_;
|
my($hash, $name) = @_;
|
||||||
|
|
||||||
# Stop the internal GetStatus-Loop and exit
|
# Stop the internal GetStatus-Loop and exit
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user