mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-09 20:57:11 +00:00
71_YAMAHA_NP:New commands 'checkForNewFirmware' and 'friendlyName'
git-svn-id: https://svn.fhem.de/fhem/trunk@19813 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
714a52ddc4
commit
8959704aa0
@ -1,5 +1,6 @@
|
||||
# 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: 71_YAMAHA_NP: New commands 'checkForNewFirmware' and 'friendlyName'
|
||||
- feature: 95_Astro: v2.1.0: add alternative global functions
|
||||
to replace SUNRISE_EL
|
||||
- feature: 98_WeekdayTimer now supports holiday2we entries
|
||||
|
@ -504,11 +504,12 @@ sub YAMAHA_NP_Set
|
||||
my $address = $hash->{helper}{ADDRESS};
|
||||
|
||||
# Get model info in case not defined
|
||||
if(not defined($hash->{MODEL}) or not defined($hash->{FIRMWARE}))
|
||||
if(not defined($hash->{MODEL}) or not defined($hash->{FIRMWARE}) or not defined($hash->{FIRMWARE_STATUS}))
|
||||
{
|
||||
YAMAHA_NP_SendCmd($hash, "GET:System,Misc,Network,Info:GetParam", "statusRequest", "networkInfo" , 0);
|
||||
YAMAHA_NP_getModel($hash);
|
||||
YAMAHA_NP_SendCmd($hash, "GET:System,Config:GetParam" , "statusRequest", "systemConfig", 0);
|
||||
YAMAHA_NP_SendCmd($hash, "GET:System,Misc,Update,Yamaha_Network_Site,Status:GetParam" , "checkForNewFirmware", "noArg", 0);
|
||||
}
|
||||
|
||||
# Setting default values. Update from device during existing communication.
|
||||
@ -553,8 +554,9 @@ sub YAMAHA_NP_Set
|
||||
# Context-sensitive command availability
|
||||
if (ReadingsVal($name,"power","") !~ m/(off|absent)/)
|
||||
{
|
||||
$usage .=" input:".$inputs_comma
|
||||
|
||||
$usage .=" friendlyName"
|
||||
." checkForNewFirmware:noArg"
|
||||
." input:".$inputs_comma
|
||||
." volumeStraight:slider,".$volumeStraightMin.",1,".$volumeStraightMax
|
||||
." volume:slider,0,1,100"
|
||||
." volumeUp:noArg"
|
||||
@ -1535,6 +1537,23 @@ desiredListNloop:
|
||||
return "Please use straight device volume range :".$hash->{helper}{VOLUMESTRAIGHTMIN}."...".$hash->{helper}{VOLUMESTRAIGHTMAX}.".";
|
||||
}
|
||||
}
|
||||
elsif($what eq "checkForNewFirmware")
|
||||
{
|
||||
YAMAHA_NP_SendCmd($hash, "GET:System,Misc,Update,Yamaha_Network_Site,Status:GetParam" , "checkForNewFirmware", "noArg", 0);
|
||||
}
|
||||
elsif($what eq "friendlyName")
|
||||
{
|
||||
# Accept 1 to 15 characters
|
||||
if (length($a[2]) >= 1 and length($a[2]) <= 15)
|
||||
{
|
||||
$hash->{helper}{friendlyName} = $a[2];
|
||||
YAMAHA_NP_SendCmd($hash, "PUT:System,Misc,Network,Network_Name:".$a[2], $what, $a[2], 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "'friendlyName' must be between 1 and 15 characters."
|
||||
}
|
||||
}
|
||||
elsif($what eq "timerSet")
|
||||
{
|
||||
# TimerSet
|
||||
@ -2369,6 +2388,28 @@ sub YAMAHA_NP_ParseResponse
|
||||
return;
|
||||
}
|
||||
}
|
||||
elsif($cmd eq "checkForNewFirmware")
|
||||
{
|
||||
if($data =~ /RC="0"/ and $data =~ /<Status>Unavailable<\/Status>/)
|
||||
{
|
||||
$hash->{FIRMWARE_STATUS} = "Most recent version installed";
|
||||
$hash->{helper}{dInfo}{FIRMWARE_STATUS} = "Most recent version installed";
|
||||
}
|
||||
else
|
||||
{
|
||||
$hash->{FIRMWARE_STATUS} = "New Firmware available";
|
||||
$hash->{helper}{dInfo}{FIRMWARE_STATUS} = "New Firmware available";
|
||||
}
|
||||
}
|
||||
elsif($cmd eq "friendlyName")
|
||||
{
|
||||
if($data =~ /RC="0"/)
|
||||
{
|
||||
$hash->{FRIENDLY_NAME} = $hash->{helper}{friendlyName};
|
||||
$hash->{helper}{dInfo}{FRIENDLY_NAME} = $hash->{helper}{friendlyName};
|
||||
delete $hash->{helper}{friendlyName};
|
||||
}
|
||||
}
|
||||
elsif($cmd eq "mute")
|
||||
{
|
||||
if($data =~ /RC="0"/){readingsBulkUpdate($hash, "mute", $arg);}
|
||||
@ -2680,12 +2721,14 @@ sub YAMAHA_NP_html2txt
|
||||
<br>
|
||||
<u>Available commands:</u><br><br>
|
||||
<li><b>CDTray</b> – open/close the CD tray.</li>
|
||||
<li><b>checkForNewFirmware</b> – Checks for firmware updates. The result is stored in 'Internals' und 'deviceInfo'.</li>
|
||||
<li><b>clockUpdate</b> – updates the system clock with current time. The local time information is taken from the FHEM server.</li>
|
||||
<li><b>dimmer</b> < 1..3 > – Sets the display brightness.</li>
|
||||
<li><b>directPlay</b> < input:Stream Level 1,Stream Level 2,... > – allows direct stream selection e.g. CD:1, DAB:1, netradio:Bookmarks,SWR3 (case–sensitive)</li>
|
||||
<li><b>favoriteDefine</b> < name:input[,Stream Level 1,Stream Level 2,...] > – defines and stores a favorite stream e.g. CoolSong:CD,1 (predefined favorites are the available inputs)</li>
|
||||
<li><b>favoriteDelete</b> < name > – deletes a favorite stream</li>
|
||||
<li><b>favoritePlay</b> < name > – plays a favorite stream</li>
|
||||
<li><b>friendlyName</b> < name > – sets network player's friendly name (network name). String must be between 1 and 15 characters.</li>
|
||||
<li><b>input</b> [<parameter>] – selects the input channel. The inputs are read dynamically from the device. Available inputs can be set (e.g. cd, tuner, aux1, aux2, ...).</li>
|
||||
<li><b>mute</b> [on|off] – activates/deactivates muting</li>
|
||||
<li><b>off</b> – shuts down the device </li>
|
||||
@ -2882,12 +2925,14 @@ sub YAMAHA_NP_html2txt
|
||||
<br>
|
||||
<u>Verfügbare Befehle:</u><br><br>
|
||||
<li><b>CDTray</b> – Öffnen und Schließen des CD–Fachs.</li>
|
||||
<li><b>checkForNewFirmware</b> – Prüft die Verfügbarkeit neuer Firmware. Das Ergebnis wird in 'Internals' and 'deviceInfo' gespeichert.</li>
|
||||
<li><b>clockUpdate</b> – Aktualisierung der Systemzeit des Network Players. Die Zeitinformation wird von dem FHEM Server bezogen, auf dem das Modul ausgeführt wird.</li>
|
||||
<li><b>dimmer</b> [1..3] – Einstellung der Anzeigehelligkeit</li>
|
||||
<li><b>directPlay</b> < input:Stream Level 1,Stream Level 2,... > – ermöglicht direktes Abspielen eines Audiostreams/einer Audiodatei z.B. CD:1, DAB:1, netradio:Bookmarks,SWR3 </li>
|
||||
<li><b>favoriteDefine</b> < name:input[,Stream Level 1,Stream Level 2,...] > – Speichert einen Favoriten e.g. CoolSong:CD,1 (vordefinierte Favoriten sind die verfügbaren Eingänge)</li>
|
||||
<li><b>favoriteDelete</b> < name > – Löscht einen Favoriten</li>
|
||||
<li><b>favoritePlay</b> < name > – Spielt einen Favoriten ab</li>
|
||||
<li><b>friendlyName</b> < name> – Setzt den Gerätenamen (friendly name / network name). String muss zwischen einem und 15 Zeichen sein.</li>
|
||||
<li><b>input</b> [<parameter>] – Auswahl des Eingangs des Network Players. (Nicht verfügbar beim ausgeschaltetem Gerät)</li>
|
||||
<li><b>mute</b> [on|off] – Aktiviert/Deaktiviert die Stummschaltung</li>
|
||||
<li><b>off</b> – Network Player ausschalten</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user