mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-28 02:44:53 +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.
|
# 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.
|
# 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: 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: 00_SONOS: New version, see Wiki- or File-Changelog
|
||||||
- update: 88_HMCCU: Code optimized. Fixed Windows process ID bug.
|
- update: 88_HMCCU: Code optimized. Fixed Windows process ID bug.
|
||||||
- bugfix: 71_YAMAHA_NP: Fixed tuner readings in standby.
|
- bugfix: 71_YAMAHA_NP: Fixed tuner readings in standby.
|
||||||
|
@ -51,6 +51,8 @@
|
|||||||
# Changelog (last 4 entries only, see Wiki for complete changelog)
|
# Changelog (last 4 entries only, see Wiki for complete changelog)
|
||||||
#
|
#
|
||||||
# SVN-History:
|
# SVN-History:
|
||||||
|
# 13.03.2017
|
||||||
|
# Saubere Fehlerbehandlung bei der Verarbeitung von currentFavouriteName, currentPlaylistName und currentRadioName.
|
||||||
# 12.03.2017
|
# 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.
|
# 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.
|
# 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);
|
readingsBeginUpdate($hash);
|
||||||
|
|
||||||
# Wurden für das Device bereits Favoriten geladen? Dann raussuchen, ob gerade ein solcher abgespielt wird...
|
# 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} = '';
|
$current{FavouriteName} = '';
|
||||||
while (my ($key, $value) = each (%favourites)) {
|
eval {
|
||||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
my %favourites = %{eval(ReadingsVal($hash->{NAME}, 'Favourites', '{}'))};
|
||||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
while (my ($key, $value) = each (%favourites)) {
|
||||||
$current{FavouriteName} = $value->{Title};
|
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...
|
# 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} = '';
|
$current{PlaylistName} = '';
|
||||||
while (my ($key, $value) = each (%playlists)) {
|
eval {
|
||||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
my %playlists = %{eval(ReadingsVal($hash->{NAME}, 'Playlists', '{}'))};
|
||||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
while (my ($key, $value) = each (%playlists)) {
|
||||||
$current{PlaylistName} = $value->{Title};
|
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...
|
# 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} = '';
|
$current{RadioName} = '';
|
||||||
while (my ($key, $value) = each (%radios)) {
|
eval {
|
||||||
if (defined($current{EnqueuedTransportURI}) && defined($value->{Ressource})) {
|
my %radios = %{eval(ReadingsVal($hash->{NAME}, 'Radios', '{}'))};
|
||||||
if ($value->{Ressource} eq $current{EnqueuedTransportURI}) {
|
while (my ($key, $value) = each (%radios)) {
|
||||||
$current{RadioName} = $value->{Title};
|
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
|
# Dekodierung durchführen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user