mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
allow multiple parameters in one set, used in LightScene
will be optimized that only one command ist send to the bridge git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2882 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1332cfb698
commit
7521c06535
@ -117,7 +117,17 @@ sub HUEDevice_Undefine($$)
|
||||
sub
|
||||
HUEDevice_Set($@)
|
||||
{
|
||||
my ($hash, $name, $cmd, $value, $value2, @a) = @_;
|
||||
my ($hash, $name, @aa) = @_;
|
||||
|
||||
if( (my $joined = join(" ", @aa)) =~ /:/ ) {
|
||||
my @cmds = split(":", $joined);
|
||||
for( my $i = 0; $i <= $#cmds; ++$i ) {
|
||||
HUEDevice_Set( $hash, $name, split(" ", $cmds[$i]) );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
my ($cmd, $value, $value2, @a) = @aa;
|
||||
|
||||
if( $cmd eq "color" ) {
|
||||
$value = int(100000/$value);
|
||||
@ -145,7 +155,7 @@ HUEDevice_Set($@)
|
||||
my $obj = {
|
||||
'on' => JSON::true,
|
||||
};
|
||||
$obj->{bri} =254 if( ReadingsVal($name,"bri","0") eq 0 );
|
||||
$obj->{bri} = 254 if( ReadingsVal($name,"bri","0") eq 0 );
|
||||
if( defined($value) ) {
|
||||
$obj->{transitiontime} = $value / 10;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user