mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
30_HUEBridge.pm: added command to delete devices in the bridge for firmware version >= 1.7
git-svn-id: https://svn.fhem.de/fhem/trunk@8202 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
99c5985e5c
commit
e02d431b9a
@ -220,6 +220,22 @@ HUEBridge_Set($@)
|
||||
|
||||
return undef;
|
||||
|
||||
} elsif($cmd eq 'delete') {
|
||||
if( defined $defs{$arg} && $defs{$arg}{TYPE} eq 'HUEDevice' ) {
|
||||
$arg = $defs{$arg}{ID};
|
||||
}
|
||||
|
||||
my $code = $name ."-". $arg;
|
||||
if( defined($modules{HUEDevice}{defptr}{$code}) ) {
|
||||
CommandDelete( undef, "$modules{HUEDevice}{defptr}{$code}{NAME}" );
|
||||
CommandSave(undef,undef) if( AttrVal( "autocreate", "autosave", 1 ) );
|
||||
}
|
||||
|
||||
my $result = HUEBridge_Call($hash, undef, "lights/$arg", undef, 'DELETE');
|
||||
return $result->{error}{description} if( $result->{error} );
|
||||
|
||||
return undef;
|
||||
|
||||
} elsif($cmd eq 'creategroup') {
|
||||
|
||||
my @lights = ();
|
||||
@ -262,7 +278,7 @@ HUEBridge_Set($@)
|
||||
return undef;
|
||||
|
||||
} else {
|
||||
my $list = "creategroup deletegroup autocreate:noArg statusRequest:noArg";
|
||||
my $list = "delete creategroup deletegroup autocreate:noArg statusRequest:noArg";
|
||||
$list .= " swupdate:noArg" if( defined($hash->{updatestate}) && $hash->{updatestate} == 2 );
|
||||
return "Unknown argument $cmd, choose one of $list";
|
||||
}
|
||||
@ -927,6 +943,8 @@ HUEBridge_HTTP_Request($$$@)
|
||||
Initiate the detection of new ZigBee devices. After aproximately one minute any newly detected
|
||||
devices can be listed with <code>get <bridge> devices</code> and the corresponding fhem devices
|
||||
can be created by <code>set <bridge> autocreate</code>.</li>
|
||||
<li>delete <name>|<id><br>
|
||||
Deletes the given device in the bridge and deletes the associated fhem device.</li>
|
||||
<li>creategroup <name> <light-1>[ <light-2>..<lignt-n>]<br>
|
||||
Create a group out of <light-1>-<light-n> in the bridge.
|
||||
The lights can be given as fhem device names or bridge device numbers.</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user