mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
ONKYO_AVR: add TYPE and attr{model}
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4622 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0100157fa5
commit
4fb52ffe81
@ -24,7 +24,7 @@
|
|||||||
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Version: 1.0.2
|
# Version: 1.0.3
|
||||||
#
|
#
|
||||||
# Major Version History:
|
# Major Version History:
|
||||||
# - 1.0.0 - 2013-12-16
|
# - 1.0.0 - 2013-12-16
|
||||||
@ -68,7 +68,7 @@ sub ONKYO_AVR_Initialize($) {
|
|||||||
$hash->{UndefFn} = "ONKYO_AVR_Undefine";
|
$hash->{UndefFn} = "ONKYO_AVR_Undefine";
|
||||||
|
|
||||||
$hash->{AttrList} =
|
$hash->{AttrList} =
|
||||||
"volumeSteps:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 inputs disable:0,1 "
|
"volumeSteps:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 inputs disable:0,1 model "
|
||||||
. $readingFnAttributes;
|
. $readingFnAttributes;
|
||||||
|
|
||||||
# $data{RC_layout}{ONKYO_AVR_SVG} = "ONKYO_AVR_RClayout_SVG";
|
# $data{RC_layout}{ONKYO_AVR_SVG} = "ONKYO_AVR_RClayout_SVG";
|
||||||
@ -165,6 +165,14 @@ sub ONKYO_AVR_GetStatus($;$) {
|
|||||||
{
|
{
|
||||||
readingsBulkUpdate( $hash, $reading,
|
readingsBulkUpdate( $hash, $reading,
|
||||||
$hash->{helper}{receiver}{device}{$reading} );
|
$hash->{helper}{receiver}{device}{$reading} );
|
||||||
|
|
||||||
|
if ( !exists( $attr{$name}{model} )
|
||||||
|
|| $attr{$name}{model} ne
|
||||||
|
$hash->{helper}{receiver}{device}{$reading} )
|
||||||
|
{
|
||||||
|
$attr{$name}{model} =
|
||||||
|
$hash->{helper}{receiver}{device}{$reading};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Firmware version
|
# Firmware version
|
||||||
@ -214,6 +222,9 @@ sub ONKYO_AVR_GetStatus($;$) {
|
|||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdate( $hash, "deviceyear", "pre2013" );
|
readingsBulkUpdate( $hash, "deviceyear", "pre2013" );
|
||||||
readingsEndUpdate( $hash, 1 );
|
readingsEndUpdate( $hash, 1 );
|
||||||
|
unless ( exists( $attr{$name}{model} ) ) {
|
||||||
|
$attr{$name}{model} = "pre2013";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Input alias handling
|
# Input alias handling
|
||||||
@ -1079,6 +1090,8 @@ sub ONKYO_AVR_Define($$) {
|
|||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hash->{TYPE} = "ONKYO_AVR";
|
||||||
|
|
||||||
my $address = $a[2];
|
my $address = $a[2];
|
||||||
$hash->{helper}{ADDRESS} = $address;
|
$hash->{helper}{ADDRESS} = $address;
|
||||||
|
|
||||||
@ -1108,6 +1121,11 @@ sub ONKYO_AVR_Define($$) {
|
|||||||
return "Invalid protocol, choose one of 2013 pre2013";
|
return "Invalid protocol, choose one of 2013 pre2013";
|
||||||
}
|
}
|
||||||
readingsSingleUpdate( $hash, "deviceyear", $protocol, 1 );
|
readingsSingleUpdate( $hash, "deviceyear", $protocol, 1 );
|
||||||
|
if ( $protocol eq "pre2013" && !exists( $attr{$name}{model} )
|
||||||
|
|| $attr{$name}{model} ne $protocol )
|
||||||
|
{
|
||||||
|
$attr{$name}{model} = $protocol;
|
||||||
|
}
|
||||||
|
|
||||||
# check values
|
# check values
|
||||||
if ( !( $zone =~ /^(main|zone2|zone3|zone4|dock)$/ ) ) {
|
if ( !( $zone =~ /^(main|zone2|zone3|zone4|dock)$/ ) ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user