30_HUEBridge.pm: document autocreate command

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7286 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2014-12-21 17:03:42 +00:00
parent e3c4d53643
commit ee4be39b0e

View File

@@ -202,10 +202,10 @@ HUEBridge_Set($@)
$hash->{STATE} = "updating"; $hash->{STATE} = "updating";
return "starting update"; return "starting update";
} elsif($cmd eq 'autocreate') { } elsif($cmd eq 'autocreate') {
HUEBridge_Autocreate($hash); HUEBridge_Autocreate($hash,1);
return undef; return undef;
} else { } else {
my $list = "statusRequest:noArg"; my $list = "autocreate:noArg statusRequest:noArg";
$list .= " swupdate:noArg" if( defined($hash->{updatestate}) && $hash->{updatestate} == 2 ); $list .= " swupdate:noArg" if( defined($hash->{updatestate}) && $hash->{updatestate} == 2 );
return "Unknown argument $cmd, choose one of $list"; return "Unknown argument $cmd, choose one of $list";
} }
@@ -272,14 +272,16 @@ HUEBridge_GetUpdate($)
} }
sub sub
HUEBridge_Autocreate($) HUEBridge_Autocreate($;$)
{ {
my ($hash)= @_; my ($hash,$force)= @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
foreach my $d (keys %defs) { if( !$force ) {
next if($defs{$d}{TYPE} ne "autocreate"); foreach my $d (keys %defs) {
return undef if(AttrVal($defs{$d}{NAME},"disable",undef)); next if($defs{$d}{TYPE} ne "autocreate");
return undef if(AttrVal($defs{$d}{NAME},"disable",undef));
}
} }
my $result = HUEBridge_Call($hash, 'lights', undef); my $result = HUEBridge_Call($hash, 'lights', undef);
@@ -583,6 +585,8 @@ HUEBridge_HTTP_Request($$$@)
<a name="HUEBridge_Set"></a> <a name="HUEBridge_Set"></a>
<b>Set</b> <b>Set</b>
<ul> <ul>
<li>autocreate<br>
Create fhem devices for all bridge devices.</li>
<li>statusRequest<br> <li>statusRequest<br>
Update bridge status.</li> Update bridge status.</li>
<li>swupdate<br> <li>swupdate<br>