mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
SONOS: Errorhandling for FavouriteName, PlaylistName and RadioName
git-svn-id: https://svn.fhem.de/fhem/trunk@13692 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e155d75708
commit
ed378ad815
@ -1,7 +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.
|
||||
- bugfix: 00_SONOS: Errorhandling for RadioName etc.
|
||||
- feature: 98_template: new FHEM command template
|
||||
- feature: 70_MEDIAPORTAL: Plugins can be retreived and changed to
|
||||
- feature: 70_MEDIAPORTAL: Plugins can be retreived and changed to
|
||||
- update: 00_SONOS: New version, see Wiki- or File-Changelog
|
||||
- update: 88_HMCCU: Code optimized. Fixed Windows process ID bug.
|
||||
- bugfix: 71_YAMAHA_NP: Fixed tuner readings in standby.
|
||||
|
@ -51,6 +51,8 @@
|
||||
# Changelog (last 4 entries only, see Wiki for complete changelog)
|
||||
#
|
||||
# SVN-History:
|
||||
# 13.03.2017
|
||||
# Saubere Fehlerbehandlung bei der Verarbeitung von currentFavouriteName, currentPlaylistName und currentRadioName.
|
||||
# 12.03.2017
|
||||
# NotifyFn und NotifyDev werden nun im Define des Moduls festgelegt (anstatt wie vorher im Initialize). Dadurch sollten deutlich weniger Notify-Anfragen beim Modul ankommen.
|
||||
# Es gibt nun einen Set-Befehl "RefreshShareIndex" zum Aktualisieren der Bibliothek und ein Reading "ShareIndexInProgress", welches angibt, ob eine Aktualisierung gerade in Ausführung ist.
|
||||
@ -1248,36 +1250,51 @@ sub SONOS_Read($) {
|
||||
readingsBeginUpdate($hash);
|
||||
|
||||
# Wurden für das Device bereits Favoriten geladen? Dann raussuchen, ob gerade ein solcher abgespielt wird...
|
||||
my %favourites = %{eval(ReadingsVal($hash->{NAME}, 'Favourites', '{}'))};
|
||||
$current{FavouriteName} = '';
|
||||
while (my ($key, $value) = each (%favourites)) {
|
||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
||||
$current{FavouriteName} = $value->{Title};
|
||||
eval {
|
||||
my %favourites = %{eval(ReadingsVal($hash->{NAME}, 'Favourites', '{}'))};
|
||||
while (my ($key, $value) = each (%favourites)) {
|
||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
||||
$current{FavouriteName} = $value->{Title};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if ($@) {
|
||||
SONOS_Log $hash->{UDN}, 1, "Error during retreiving of FavouriteName: $@";
|
||||
}
|
||||
|
||||
# Wurden für das Device bereits Playlisten geladen? Dann raussuchen, ob gerade eine solche abgespielt wird...
|
||||
my %playlists = %{eval(ReadingsVal($hash->{NAME}, 'Playlists', '{}'))};
|
||||
$current{PlaylistName} = '';
|
||||
while (my ($key, $value) = each (%playlists)) {
|
||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
||||
$current{PlaylistName} = $value->{Title};
|
||||
eval {
|
||||
my %playlists = %{eval(ReadingsVal($hash->{NAME}, 'Playlists', '{}'))};
|
||||
while (my ($key, $value) = each (%playlists)) {
|
||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
||||
$current{PlaylistName} = $value->{Title};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if ($@) {
|
||||
SONOS_Log $hash->{UDN}, 1, "Error during retreiving of PlaylistName: $@";
|
||||
}
|
||||
|
||||
# Wurden für das Device bereits Radios geladen? Dann raussuchen, ob gerade ein solches abgespielt wird...
|
||||
my %radios = %{eval(ReadingsVal($hash->{NAME}, 'Radios', '{}'))};
|
||||
$current{RadioName} = '';
|
||||
while (my ($key, $value) = each (%radios)) {
|
||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
||||
$current{RadioName} = $value->{Title};
|
||||
eval {
|
||||
my %radios = %{eval(ReadingsVal($hash->{NAME}, 'Radios', '{}'))};
|
||||
while (my ($key, $value) = each (%radios)) {
|
||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
||||
$current{RadioName} = $value->{Title};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if ($@) {
|
||||
SONOS_Log $hash->{UDN}, 1, "Error during retreiving of RadioName: $@";
|
||||
}
|
||||
|
||||
# Dekodierung durchführen
|
||||
|
Loading…
Reference in New Issue
Block a user