2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

30_HUEBridge.pm: added autodetect command

git-svn-id: https://svn.fhem.de/fhem/trunk@7359 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-12-29 16:16:31 +00:00
parent 1fd866ec49
commit 7a123752bd

View File

@ -210,6 +210,14 @@ HUEBridge_Set($@)
} elsif($cmd eq 'autocreate') { } elsif($cmd eq 'autocreate') {
return HUEBridge_Autocreate($hash,1); return HUEBridge_Autocreate($hash,1);
} elsif($cmd eq 'autodetect') {
my $result = HUEBridge_Call($hash, undef, 'lights', undef, 'POST');
return $result->{success}{'/lights'} if( $result->{success} );
return $result->{error}{description} if( $result->{error} );
return undef;
} elsif($cmd eq 'creategroup') { } elsif($cmd eq 'creategroup') {
my @lights = (); my @lights = ();
@ -882,17 +890,23 @@ HUEBridge_HTTP_Request($$$@)
<b>Set</b> <b>Set</b>
<ul> <ul>
<li>autocreate<br> <li>autocreate<br>
Create fhem devices for all bridge devices.</li> Create fhem devices for all bridge devices.</li>
<li>autodetect<br>
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>creategroup &lt;name&gt; &lt;light-1&gt[ &lt;light-2&gt;..&lt;lignt-n&gt;]<br> <li>creategroup &lt;name&gt; &lt;light-1&gt[ &lt;light-2&gt;..&lt;lignt-n&gt;]<br>
Create a group out of &lt;light-1&gt-&lt;light-n&gt in the bridge. Create a group out of &lt;light-1&gt-&lt;light-n&gt in the bridge.
The lights can be given as fhem device names or bridge device numbers.</li> The lights can be given as fhem device names or bridge device numbers.</li>
<li>deletegroup &lt;name&gt;|&lt;id&gt;<br> <li>deletegroup &lt;name&gt;|&lt;id&gt;<br>
Deletes the given group in the bridge and deletes the associated fhem device.</li> Deletes the given group in the bridge and deletes the associated fhem device.</li>
<li>statusRequest<br> <li>statusRequest<br>
Update bridge status.</li> Update bridge status.</li>
<li>swupdate<br> <li>swupdate<br>
Update bridge firmware. This command is only available if a new firmware is available (indicated by updatestate with a value of 2. The version and release date is shown in the reading swupdate.<br> Update bridge firmware. This command is only available if a new firmware is
A notify of the form <code>define HUEUpdate notify bridge:swupdate.* {...}</code> can be used to be informed about available firmware updates.<br></li> available (indicated by updatestate with a value of 2. The version and release date is shown in the reading swupdate.<br>
A notify of the form <code>define HUEUpdate notify bridge:swupdate.* {...}</code>
can be used to be informed about available firmware updates.<br></li>
</ul><br> </ul><br>
</ul><br> </ul><br>