mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
Sonos: Correct handling of device-modifying
git-svn-id: https://svn.fhem.de/fhem/trunk@14715 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fb00e9f1f9
commit
877e875e22
@ -51,6 +51,9 @@
|
||||
# Changelog (last 4 entries only, see Wiki for complete changelog)
|
||||
#
|
||||
# SVN-History:
|
||||
# 14.07.2017
|
||||
# Änderung in der ControlPoint.pm: Es wurden zuviele Suchantworten berücksichtigt.
|
||||
# Bei einem Modify wird von Fhem nur die DefFn aufgerufen (und nicht vorher UndefFn). Dadurch blieben Reste, die aber vor einer Definition aufgeräumt werden müssen. Resultat war eine 100%-CPU-Last.
|
||||
# 09.07.2017
|
||||
# BulkUpdate: Beginn und Ende sind nun sicher davor einen vom SubProzess gestarteten BulkUpdate vorzeitig zu beenden.
|
||||
# 05.07.2017
|
||||
@ -878,6 +881,17 @@ sub SONOS_Define($$) {
|
||||
my ($hash, $def) = @_;
|
||||
my @a = split("[ \t]+", $def);
|
||||
|
||||
# Check if we just want a modify...
|
||||
if ($hash->{NAME}) {
|
||||
SONOS_Log undef, 1, 'Modify Device: '.$hash->{NAME};
|
||||
|
||||
# Alle Timer entfernen...
|
||||
RemoveInternalTimer($hash);
|
||||
|
||||
# SubProzess beenden, und Verbindung kappen...
|
||||
SONOS_StopSubProcess($hash);
|
||||
}
|
||||
|
||||
# check syntax
|
||||
return 'Usage: define <name> SONOS [[[[upnplistener] interval] waittime] delaytime]' if($#a < 1 || $#a > 5);
|
||||
my $name = $a[0];
|
||||
|
@ -208,6 +208,14 @@ sub SONOSPLAYER_Initialize ($) {
|
||||
sub SONOSPLAYER_Define ($$) {
|
||||
my ($hash, $def) = @_;
|
||||
|
||||
# Check if we just want a modify...
|
||||
if ($hash->{NAME}) {
|
||||
SONOS_Log undef, 1, 'Modify SonosPlayer-Device: '.$hash->{NAME};
|
||||
|
||||
# Alle Timer entfernen...
|
||||
RemoveInternalTimer($hash);
|
||||
}
|
||||
|
||||
# define <name> SONOSPLAYER <udn>
|
||||
# e.g.: define Sonos_Wohnzimmer SONOSPLAYER RINCON_000EFEFEFEF401400
|
||||
my @a = split("[ \t]+", $def);
|
||||
|
@ -418,7 +418,7 @@ sub _receiveSearchResponse {
|
||||
last;
|
||||
}
|
||||
|
||||
if ($search->{_friendlyName} && $search->{_friendlyName}) {
|
||||
if ($search->{_friendlyName} && $buf =~ $search->{_friendlyName}) {
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user