[onkyo] Add audio info channel (IFA Eiscp command) (#10483)

* Add audio info channel

Signed-off-by: Jared <39014663+baku104788@users.noreply.github.com>

* Audio Info Channel implementation

Signed-off-by: Jared <39014663+baku104788@users.noreply.github.com>

* remove extra backup file

Signed-off-by: Jared <39014663+baku104788@users.noreply.github.com>

* Update readme info for audioinfo

Signed-off-by: Jared <39014663+baku104788@users.noreply.github.com>
This commit is contained in:
Jared 2021-04-16 14:41:40 -05:00 committed by GitHub
parent 2e421267cf
commit 4300c642c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 2 deletions

View File

@ -150,6 +150,7 @@ The Onkyo AVR supports the following channels (some channels are model specific)
| player#artist | String | Artist name of the current song (available if playing from Network or USB) | | player#artist | String | Artist name of the current song (available if playing from Network or USB) |
| player#currentPlayingTime | String | Current playing time of the current song (available if playing from Network or USB) | | player#currentPlayingTime | String | Current playing time of the current song (available if playing from Network or USB) |
| player#listenmode | Number | Current listening mode e.g. Stereo, 5.1ch Surround, ... | | player#listenmode | Number | Current listening mode e.g. Stereo, 5.1ch Surround, ... |
| player#audioinfo | String | Current audio info (Refresh timer must be configured for updates) |
| player#playuri | String | Plays the URI provided to the channel | | player#playuri | String | Plays the URI provided to the channel |
| player#albumArt | Image | Image of the current album art of the current song | | player#albumArt | Image | Image of the current album art of the current song |
| player#albumArtUrl | String | URL to the current album art of the current song | | player#albumArtUrl | String | URL to the current album art of the current song |

View File

@ -73,6 +73,7 @@ public class OnkyoBindingConstants {
public static final String CHANNEL_ALBUM_ART = "player#albumArt"; public static final String CHANNEL_ALBUM_ART = "player#albumArt";
public static final String CHANNEL_ALBUM_ART_URL = "player#albumArtUrl"; public static final String CHANNEL_ALBUM_ART_URL = "player#albumArtUrl";
public static final String CHANNEL_LISTENMODE = "player#listenmode"; public static final String CHANNEL_LISTENMODE = "player#listenmode";
public static final String CHANNEL_AUDIOINFO = "player#audioinfo";
public static final String CHANNEL_PLAY_URI = "player#playuri"; public static final String CHANNEL_PLAY_URI = "player#playuri";
public static final String CHANNEL_NET_MENU_TITLE = "netmenu#title"; public static final String CHANNEL_NET_MENU_TITLE = "netmenu#title";

View File

@ -38,6 +38,9 @@ public enum EiscpCommand {
VOLUME_SET("MVL", "%02X"), VOLUME_SET("MVL", "%02X"),
VOLUME("MVL", ""), VOLUME("MVL", ""),
AUDIOINFO("IFA", ""),
AUDIOINFO_QUERY("IFA", "QSTN"),
SOURCE_UP("SLI", "UP"), SOURCE_UP("SLI", "UP"),
SOURCE_DOWN("SLI", "DOWN"), SOURCE_DOWN("SLI", "DOWN"),
SOURCE_QUERY("SLI", "QSTN"), SOURCE_QUERY("SLI", "QSTN"),

View File

@ -122,6 +122,7 @@ public class OnkyoHandler extends UpnpAudioSinkHandler implements OnkyoEventList
updateStatus(ThingStatus.ONLINE); updateStatus(ThingStatus.ONLINE);
sendCommand(EiscpCommand.INFO_QUERY); sendCommand(EiscpCommand.INFO_QUERY);
sendCommand(EiscpCommand.AUDIOINFO_QUERY);
} }
}); });
@ -324,7 +325,11 @@ public class OnkyoHandler extends UpnpAudioSinkHandler implements OnkyoEventList
sendCommand(EiscpCommand.NETUSB_TITLE_QUERY); sendCommand(EiscpCommand.NETUSB_TITLE_QUERY);
} }
break; break;
case CHANNEL_AUDIOINFO:
if (command.equals(RefreshType.REFRESH)) {
sendCommand(EiscpCommand.AUDIOINFO_QUERY);
}
break;
/* /*
* MISC * MISC
*/ */
@ -477,7 +482,10 @@ public class OnkyoHandler extends UpnpAudioSinkHandler implements OnkyoEventList
/* /*
* MISC * MISC
*/ */
case AUDIOINFO:
updateState(CHANNEL_AUDIOINFO, convertDeviceValueToOpenHabState(data.getValue(), StringType.class));
logger.debug("audioinfo message: '{}'", data.getValue());
break;
case INFO: case INFO:
processInfo(data.getValue()); processInfo(data.getValue());
logger.debug("Info message: '{}'", data.getValue()); logger.debug("Info message: '{}'", data.getValue());
@ -797,6 +805,7 @@ public class OnkyoHandler extends UpnpAudioSinkHandler implements OnkyoEventList
sendCommand(EiscpCommand.NETUSB_TITLE_QUERY); sendCommand(EiscpCommand.NETUSB_TITLE_QUERY);
sendCommand(EiscpCommand.LISTEN_MODE_QUERY); sendCommand(EiscpCommand.LISTEN_MODE_QUERY);
sendCommand(EiscpCommand.INFO_QUERY); sendCommand(EiscpCommand.INFO_QUERY);
sendCommand(EiscpCommand.AUDIOINFO_QUERY);
if (isChannelAvailable(CHANNEL_POWERZONE2)) { if (isChannelAvailable(CHANNEL_POWERZONE2)) {
sendCommand(EiscpCommand.ZONE2_POWER_QUERY); sendCommand(EiscpCommand.ZONE2_POWER_QUERY);

View File

@ -45,6 +45,7 @@
<channel id="album" typeId="album"/> <channel id="album" typeId="album"/>
<channel id="artist" typeId="artist"/> <channel id="artist" typeId="artist"/>
<channel id="listenmode" typeId="listenmode"/> <channel id="listenmode" typeId="listenmode"/>
<channel id="audioinfo" typeId="audioinfo"/>
<channel id="playuri" typeId="playuri"/> <channel id="playuri" typeId="playuri"/>
<channel id="albumArt" typeId="albumArt"/> <channel id="albumArt" typeId="albumArt"/>
<channel id="albumArtUrl" typeId="albumArtUrl"/> <channel id="albumArtUrl" typeId="albumArtUrl"/>

View File

@ -107,6 +107,11 @@
<label>Play URI</label> <label>Play URI</label>
<description>Plays a given URI</description> <description>Plays a given URI</description>
</channel-type> </channel-type>
<channel-type id="audioinfo" advanced="true">
<item-type>String</item-type>
<label>Audio Info</label>
<description>Detailed audio info</description>
</channel-type>
<channel-type id="netControl" advanced="true"> <channel-type id="netControl" advanced="true">
<item-type>String</item-type> <item-type>String</item-type>
<label>Control</label> <label>Control</label>