From 62a43749e6e5049f2f86f9127b35fb98db194162 Mon Sep 17 00:00:00 2001 From: ra666ack Date: Wed, 27 Apr 2016 18:00:43 +0000 Subject: [PATCH] 71_PHILIPS_AUDIO: Added input support for AW9000 git-svn-id: https://svn.fhem.de/fhem/trunk@11329 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/71_PHILIPS_AUDIO.pm | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 169b39986..00260a346 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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_PHILIPS_AUDIO : Added input support for AW9000 - bugfix: 50_TelegramBot: contact handling failed (/ in contact names ??) - feature: new module 02_FTUISRV.pm for server side templates for tablet UI - feature: 30_pilight_switch: new attribute 'sendCount' to send the diff --git a/fhem/FHEM/71_PHILIPS_AUDIO.pm b/fhem/FHEM/71_PHILIPS_AUDIO.pm index 0a3252934..baa29a1e4 100755 --- a/fhem/FHEM/71_PHILIPS_AUDIO.pm +++ b/fhem/FHEM/71_PHILIPS_AUDIO.pm @@ -8,7 +8,7 @@ # such as MCi, Streamium and Fidelio devices. # The module provides basic functionality accessible through the port 8889 of the device: # (http://:8889/index). -# e.g. NP3500, NP3700, NP3900. +# e.g. AW9000, NP3500, NP3700, NP3900 # # Copyright by Radoslaw Watroba # (e-mail: ra666ack at g**glemail d*t c*m) @@ -177,6 +177,8 @@ sub PHILIPS_AUDIO_Set my $usage; + my $model = $hash->{MODEL}; + $usage = "Unknown argument $what, choose one of ". "volumeStraight:slider,0,1,64 ". "volume:slider,0,1,100 ". @@ -190,6 +192,9 @@ sub PHILIPS_AUDIO_Set "stop:noArg ". "shuffle:on,off ". "aux:noArg ". + ((uc($model) eq "AW9000") ? "mp3link:noArg " : ""). # Input implemented in AW9000 only + ((uc($model) eq "AW9000") ? "coaxial:noArg " : ""). # Input implemented in AW9000 only + ((uc($model) eq "AW9000") ? "optical:noArg " : ""). # Input implemented in AW9000 only #"input:aux,internetRadio,mediaLibrary,onlineServices ". $inetRadioPreset. $inetRadioFavorite. @@ -214,6 +219,18 @@ sub PHILIPS_AUDIO_Set { PHILIPS_AUDIO_SendCommand($hash, "/aux", "",$what, $a[2]); } + elsif($what eq "mp3link") + { + PHILIPS_AUDIO_SendCommand($hash, "/mp3link", "",$what, $a[2]); + } + elsif($what eq "coaxial") + { + PHILIPS_AUDIO_SendCommand($hash, "/digin_coaxial", "",$what, $a[2]); + } + elsif($what eq "optical") + { + PHILIPS_AUDIO_SendCommand($hash, "/digin_optical", "",$what, $a[2]); + } elsif($what eq "home") { PHILIPS_AUDIO_SendCommand($hash, "/index", "",$what, $a[2]); @@ -399,7 +416,7 @@ sub PHILIPS_AUDIO_Define if(defined($a[2])) { - $hash->{MODEL} = $a[2]; + $hash->{MODEL} = uc($a[2]); # Used by 'fheminfo' command for statistics $attr{$name}{"model"} = $hash->{MODEL}; @@ -819,7 +836,7 @@ sub PHILIPS_AUDIO_ParseResponse } } - # Eventual future UPNP implementation. Requests IO::Socket::Multicast non-standard module. + # Eventual future UPNP implementation. Requires IO::Socket::Multicast non-standard module. elsif ($cmd eq "getModel") { if($data =~ /(.+)<\/friendlyName>/) @@ -1225,6 +1242,8 @@ sub PHILIPS_AUDIO_updateFavorites This module controls a Philips Audio Player e.g. MCi, Streamium or Fidelio and (potentially) any other device including a navigation server.
To check, open the following URL in the browser: http://[ip # of your device]:8889/index

+ (So far tested on: AW9000, NP3500, NP3700 and NP3900) +

Currently implemented features:

    @@ -1393,7 +1412,10 @@ sub PHILIPS_AUDIO_updateFavorites Mit Hilfe dieses Moduls lassen sich Philips Audio Netzwerk Player wie z.B. MCi, Streamium oder Fidelio via Ethernet steuern.
    Theoretisch sollten alle Geräte, die über einer implementierten HTTP Server am Port 8889 haben (http://[ip Nummer des Gerätes]:8889/index), bedient werden können.

    - +
    + (Getestet mit: AW9000, NP3500, NP3700 und NP3900) +
    +
    Die aktuelle Implementierung ermöglicht u.a. den folgenden Funktionsumfang:

    • Power on/off