mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 04:36:36 +00:00
55_GDS.pm: modified undefine
Delete gds webservice if last gds device deleted. git-svn-id: https://svn.fhem.de/fhem/trunk@7791 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a504f0ca0e
commit
44630e384b
@ -103,8 +103,8 @@ sub GDS_Define($$$) {
|
||||
$hash->{helper}{URL} = "ftp-outgoing2.dwd.de";
|
||||
$hash->{helper}{INTERVAL} = 1200;
|
||||
|
||||
Log3($name, 3, "GDS $name: created");
|
||||
Log3($name, 3, "GDS $name: tempDir=".$tempDir);
|
||||
Log3($name, 4, "GDS $name: created");
|
||||
Log3($name, 4, "GDS $name: tempDir=".$tempDir);
|
||||
|
||||
fillMappingTables($hash);
|
||||
initDropdownLists($hash);
|
||||
@ -131,6 +131,15 @@ sub GDS_Undef($$) {
|
||||
my ($hash, $arg) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
RemoveInternalTimer($hash);
|
||||
# check if last gds device
|
||||
my $url = '/gds';
|
||||
my $gdsPresent = 0;
|
||||
foreach my $def (sort keys %defs) {
|
||||
$gdsPresent += 1 if($defs{$def}{TYPE} eq "GDS");
|
||||
last if $gdsPresent == 2;
|
||||
}
|
||||
# if last gds device, remove FWEXT
|
||||
$data{FWEXT}{$url} = undef if $gdsPresent == 1;
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user