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

31_HUEDevice.pm, 33_readingsProxy.pm: SetExtensionsCancel simplification

git-svn-id: https://svn.fhem.de/fhem/trunk@12689 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2016-11-29 21:43:01 +00:00
parent 8d7d815c60
commit 151b17a4f8
2 changed files with 5 additions and 14 deletions

View File

@ -677,10 +677,7 @@ HUEDevice_Set($@)
}
}
$hash->{InSetExtensions} = 1;
my $ret = SetExtensions($hash, $list, $name, @aa);
delete $hash->{InSetExtensions};
return $ret;
return SetExtensions($hash, $list, $name, @aa);
}
if( $cmd eq 'rename' ) {
@ -750,11 +747,7 @@ HUEDevice_Set($@)
$result = HUEDevice_ReadFromServer($hash,"$hash->{ID}/state",\%obj);
}
if( !$hash->{InSetExtensions} ) {
SetExtensionsCancel($hash);
my $at = $name ."_till";
CommandDelete(undef, $at) if($defs{$at});
}
SetExtensionsCancel($hash);
if( defined($result) && $result->{'error'} ) {
$hash->{STATE} = $result->{'error'}->{'description'};
@ -793,11 +786,7 @@ HUEDevice_Set($@)
$list .= " savescene deletescene scene" if( $hash->{helper}->{devtype} eq 'G' );
$list .= " rename";
$hash->{InSetExtensions} = 1;
my $ret = SetExtensions($hash, $list, $name, @aa);
delete $hash->{InSetExtensions};
return $ret;
return SetExtensions($hash, $list, $name, @aa);
}
sub

View File

@ -218,6 +218,8 @@ readingsProxy_Set($@)
}
return SetExtensions($hash,$setList,$name,@a) if( !$found );
SetExtensionsCancel($hash);
my $v = join(" ", @a);
my $set_fn = AttrVal( $hash->{NAME}, "setFn", "" );
if( $set_fn =~ m/^{.*}$/s ) {