From a3cf22a344fd5f935ebc2e5296e4dd7647246737 Mon Sep 17 00:00:00 2001 From: loredo Date: Tue, 31 May 2016 19:15:40 +0000 Subject: [PATCH] 70_ONKYO_AVR.pm,71_ONKYO_AVR_ZONE.pm: early update of readings power,stateAV after set power on git-svn-id: https://svn.fhem.de/fhem/trunk@11580 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/70_ONKYO_AVR.pm | 16 ++++++++++++++++ fhem/FHEM/71_ONKYO_AVR_ZONE.pm | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/fhem/FHEM/70_ONKYO_AVR.pm b/fhem/FHEM/70_ONKYO_AVR.pm index 6af6758a9..01064c436 100644 --- a/fhem/FHEM/70_ONKYO_AVR.pm +++ b/fhem/FHEM/70_ONKYO_AVR.pm @@ -2054,6 +2054,22 @@ sub ONKYO_AVR_Set($$$) { else { Log3 $name, 3, "ONKYO_AVR set $name " . @$a[1]; $return = ONKYO_AVR_SendCommand( $hash, "power", "on" ); + + # don't wait for receiver to confirm power on + # + + readingsBeginUpdate($hash); + + # power + readingsBulkUpdate( $hash, "power", "on" ) + if ( ReadingsVal( $name, "power", "-" ) ne "on" ); + + # stateAV + my $stateAV = ONKYO_AVR_GetStateAV($hash); + readingsBulkUpdate( $hash, "stateAV", $stateAV ) + if ( ReadingsVal( $name, "stateAV", "-" ) ne $stateAV ); + + readingsEndUpdate( $hash, 1 ); } } diff --git a/fhem/FHEM/71_ONKYO_AVR_ZONE.pm b/fhem/FHEM/71_ONKYO_AVR_ZONE.pm index 4a99bb8ed..89671df26 100644 --- a/fhem/FHEM/71_ONKYO_AVR_ZONE.pm +++ b/fhem/FHEM/71_ONKYO_AVR_ZONE.pm @@ -780,6 +780,22 @@ sub ONKYO_AVR_ZONE_Set($$$) { else { Log3 $name, 3, "ONKYO_AVR_ZONE set $name " . @$a[1]; $return = ONKYO_AVR_ZONE_SendCommand( $hash, "power", "on" ); + + # don't wait for receiver to confirm power on + # + + readingsBeginUpdate($hash); + + # power + readingsBulkUpdate( $hash, "power", "on" ) + if ( ReadingsVal( $name, "power", "-" ) ne "on" ); + + # stateAV + my $stateAV = ONKYO_AVR_ZONE_GetStateAV($hash); + readingsBulkUpdate( $hash, "stateAV", $stateAV ) + if ( ReadingsVal( $name, "stateAV", "-" ) ne $stateAV ); + + readingsEndUpdate( $hash, 1 ); } }