From 13afc250ef83ae206e34a1702b7a5ac39013b94a Mon Sep 17 00:00:00 2001
From: markusbloch <>
Date: Tue, 18 Aug 2015 21:42:04 +0000
Subject: [PATCH] YAMAHA_AVR: new reading "newFirmware" for indicating firmware
update. new argument "direct" for volume commands to avoid volume smoothing,
if activated (Forum: #19896)
git-svn-id: https://svn.fhem.de/fhem/trunk@9092 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 3 +++
fhem/FHEM/71_YAMAHA_AVR.pm | 31 ++++++++++++++++++++++---------
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index 03df605a2..2d24f32b6 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - feature: YAMAHA_AVR: new reading "newFirmware" for indicating firmware
+ update. new argument "direct" for volume commands to avoid
+ volume smoothing (if activated)
- added: 70_VolumeLink.pm: New module to link the volume-level and mute-state
from a physical-device (e.g. a TV) with a fhem-device (e.g.
a SONOS-Playbar or an AVR).
diff --git a/fhem/FHEM/71_YAMAHA_AVR.pm b/fhem/FHEM/71_YAMAHA_AVR.pm
index 25fc0d660..3c746bf73 100755
--- a/fhem/FHEM/71_YAMAHA_AVR.pm
+++ b/fhem/FHEM/71_YAMAHA_AVR.pm
@@ -97,6 +97,9 @@ YAMAHA_AVR_GetStatus($;$)
}
YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam$zone>", "statusRequest", "basicStatus");
+ YAMAHA_AVR_SendCommand($hash, "GetParam", "statusRequest", "fwUpdate", 1);
+ YAMAHA_AVR_SendCommand($hash, "GetParam", "statusRequest", "fwUpdate", 1);
+ YAMAHA_AVR_SendCommand($hash, "GetParam", "statusRequest", "partyMode");
YAMAHA_AVR_ResetTimer($hash) unless($local == 1);
}
@@ -352,7 +355,7 @@ YAMAHA_AVR_Set($@)
}
# Only if a volume reading exists and smoohing is really needed (step difference is not zero)
- if(defined($hash->{READINGS}{volumeStraight}{VAL}) and $diff != 0)
+ if(defined($hash->{READINGS}{volumeStraight}{VAL}) and $diff != 0 and not (defined($a[3]) and $a[3] eq "direct"))
{
Log3 $name, 4, "YAMAHA_AVR ($name) - set volume to ".($current_volume + $diff)." dB (target is $target_volume dB)";
YAMAHA_AVR_SendCommand($hash, "<$zone><$volume_cmd>".(($current_volume + $diff)*10)."1dB$volume_cmd>$zone>", "volume", ($current_volume + $diff)."|$diff|$target_volume" );
@@ -1190,6 +1193,14 @@ YAMAHA_AVR_ParseResponse ($$$)
readingsBulkUpdate($hash, "repeat", lc($1));
}
}
+ elsif($arg eq "fwUpdate")
+ {
+ if($data =~ /(.+?)<\/Status>/)
+ {
+ readingsBulkUpdate($hash, "newFirmware", lc($1));
+ }
+
+ }
}
elsif($cmd eq "on")
{
@@ -1564,10 +1575,10 @@ sub YAMAHA_AVR_html2txt($)
off - shuts down the device
input hdm1,hdmX,... - selects the input channel (only the real available inputs were given)
scene scene1,sceneX - select the scene
-volume 0...100 - set the volume level in percentage
-volumeStraight -80...15 - set the volume level in decibel
-volumeUp [0-100] - increases the volume level by 5% or the value of attribute volumeSteps (optional the increasing level can be given as argument, which will be used instead)
-volumeDown [0-100] - decreases the volume level by 5% or the value of attribute volumeSteps (optional the decreasing level can be given as argument, which will be used instead)
+volume 0...100 [direct] - set the volume level in percentage. If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
+volumeStraight -80...15 [direct] - set the volume level in decibel. If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
+volumeUp [0-100] [direct] - increases the volume level by 5% or the value of attribute volumeSteps (optional the increasing level can be given as argument, which will be used instead). If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
+volumeDown [0-100] [direct] - decreases the volume level by 5% or the value of attribute volumeSteps (optional the decreasing level can be given as argument, which will be used instead). If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
mute on|off|toggle - activates volume mute
dsp hallinmunich,hallinvienna,... - sets the DSP mode to the given preset
enhancer on|off - controls the internal sound enhancer
@@ -1692,6 +1703,7 @@ sub YAMAHA_AVR_html2txt($)
input - The selected input source according to the FHEM input commands
inputName - The input description as seen on the receiver display
mute - Reports the mute status of the receiver or zone (can be "on" or "off")
+ newFirmware - indicates if a firmware update is available (can be "available" or "unavailable")
power - Reports the power status of the receiver or zone (can be "on" or "off")
presence - Reports the presence status of the receiver or zone (can be "absent" or "present"). In case of an absent device, it cannot be controlled via FHEM anymore.
volume - Reports the current volume level of the receiver or zone in percentage values (between 0 and 100 %)
@@ -1806,10 +1818,10 @@ sub YAMAHA_AVR_html2txt($)
direct on,off - Umgeht alle internen soundverbessernden Maßnahmen (Equalizer, Enhancer, Adaptive DRC,...) und gibt das Signal unverfälscht wieder
input hdmi1,hdmiX,... - Wählt den Eingangskanal (es werden nur die tatsächlich verfügbaren Eingänge angeboten)
scene scene1,sceneX - Wählt eine vorgefertigte Szene aus
-volume 0...100 - Setzt die Lautstärke in Prozent (0 bis 100%)
-volumeStraight -87...15 - Setzt die Lautstärke in Dezibel (-80.5 bis 15.5 dB) so wie sie am Receiver auch verwendet wird.
-volumeUp [0...100] - Erhöht die Lautstärke um 5% oder entsprechend dem Attribut volumeSteps (optional kann der Wert auch als Argument angehangen werden, dieser hat dann Vorang)
-volumeDown [0...100] - Veringert die Lautstärke um 5% oder entsprechend dem Attribut volumeSteps (optional kann der Wert auch als Argument angehangen werden, dieser hat dann Vorang)
+volume 0...100 [direct] - Setzt die Lautstärke in Prozent (0 bis 100%). Wenn als zweites Argument "direct" gesetzt ist, wird keine weiche Lautstärkenanpassung durchgeführt (sofern aktiviert). Die Lautstärke wird in diesem Fall sofort gesetzt.
+volumeStraight -87...15 [direct] - Setzt die Lautstärke in Dezibel (-80.5 bis 15.5 dB) so wie sie am Receiver auch verwendet wird. Wenn als zweites Argument "direct" gesetzt ist, wird keine weiche Lautstärkenanpassung durchgeführt (sofern aktiviert). Die Lautstärke wird in diesem Fall sofort gesetzt.
+volumeUp [0...100] [direct] - Erhöht die Lautstärke um 5% oder entsprechend dem Attribut volumeSteps (optional kann der Wert auch als Argument angehangen werden, dieser hat dann Vorang). Wenn als zweites Argument "direct" gesetzt ist, wird keine weiche Lautstärkenanpassung durchgeführt (sofern aktiviert). Die Lautstärke wird in diesem Fall sofort gesetzt.
+volumeDown [0...100] [direct] - Veringert die Lautstärke um 5% oder entsprechend dem Attribut volumeSteps (optional kann der Wert auch als Argument angehangen werden, dieser hat dann Vorang). Wenn als zweites Argument "direct" gesetzt ist, wird keine weiche Lautstärkenanpassung durchgeführt (sofern aktiviert). Die Lautstärke wird in diesem Fall sofort gesetzt.
mute on,off,toggle - Schaltet den Receiver stumm
straight on,off - Umgeht die interne Codec-Umwandlung und gibt den Original-Codec wieder.
sleep off,30min,60min,...,last - Aktiviert den internen Sleep-Timer zum automatischen Abschalten
@@ -1924,6 +1936,7 @@ sub YAMAHA_AVR_html2txt($)
input - Der ausgewählte Eingang entsprechend dem FHEM-Kommando
inputName - Die Eingangsbezeichnung, so wie sie am Receiver eingestellt wurde und auf dem Display erscheint
mute - Der aktuelle Stumm-Status ("on" => Stumm, "off" => Laut)
+ newFirmware - Zeigt an, ob eine neue Firmware zum installieren bereit liegt ("available" => neue Firmware verfügbar, "unavailable" => keine neue Firmware verfügbar)
power - Der aktuelle Betriebsstatus ("on" => an, "off" => aus)
presence - Die aktuelle Empfangsbereitschaft ("present" => empfangsbereit, "absent" => nicht empfangsbereit, z.B. Stromausfall)
volume - Der aktuelle Lautstärkepegel in Prozent (zwischen 0 und 100 %)