cmd line parsing fix

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@5605 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2014-04-23 10:13:24 +00:00
parent b71dceb8bd
commit e05e7cb557

View File

@@ -48,18 +48,14 @@ readingsProxy_updateDevices($)
my %list;
delete $hash->{DEVICE};
delete $hash->{READING};
my @params = split(" ", $hash->{DEF});
while (@params) {
my $param = shift(@params);
my @device = split(":", $param);
if( defined($defs{$device[0]})
&& defined($defs{$device[0]}) ) {
$list{$device[0]} = 1;
$hash->{DEVICE} = $device[0];
$hash->{READING} = $device[1];
}
if( defined($defs{$params[0]}) ) {
$list{$params[0]} = 1;
$hash->{DEVICE} = $params[0];
$hash->{READING} = $params[1];
}
$hash->{CONTENT} = \%list;