2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-15 04:20:56 +00:00

cmd line parsing fix

git-svn-id: https://svn.fhem.de/fhem/trunk@5605 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-04-23 10:13:24 +00:00
parent 5dbc39d953
commit 5f070d9c9a

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;