mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_fheminfo.pm: minor code improvements
git-svn-id: https://svn.fhem.de/fhem/trunk@14839 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e1fe1fe23a
commit
e95fb73f3f
@ -29,7 +29,8 @@ my $c_noModel = 'noModel';
|
|||||||
|
|
||||||
my %fhemInfo = ();
|
my %fhemInfo = ();
|
||||||
my @ignoreList = qw(Global);
|
my @ignoreList = qw(Global);
|
||||||
my @noModelList = qw(knx dummy at archetype weather pushover twilight hminfo readingsgroup);
|
my @noModelList = qw(readingsgroup doif lacrosse zwdongle wol weekdaytimer
|
||||||
|
cul_rfr solarview lw12 tscul knx dummy at archetype weather pushover twilight hminfo readingsgroup);
|
||||||
|
|
||||||
sub fheminfo_Initialize($$) {
|
sub fheminfo_Initialize($$) {
|
||||||
my %hash = (
|
my %hash = (
|
||||||
@ -94,8 +95,10 @@ sub _fi2_Count() {
|
|||||||
my $model = $c_noModel;
|
my $model = $c_noModel;
|
||||||
|
|
||||||
# 2. look for model information in internals
|
# 2. look for model information in internals
|
||||||
$model = defined($defs{$key}{model}) ? $defs{$key}{model} : $model;
|
unless (lc($type) eq 'knx') {
|
||||||
$model = defined($defs{$key}{MODEL}) ? $defs{$key}{MODEL} : $model;
|
$model = defined($defs{$key}{model}) ? $defs{$key}{model} : $model;
|
||||||
|
$model = defined($defs{$key}{MODEL}) ? $defs{$key}{MODEL} : $model;
|
||||||
|
}
|
||||||
|
|
||||||
# 3. look for model information in attributes
|
# 3. look for model information in attributes
|
||||||
$model = AttrVal($name,'model',$model);
|
$model = AttrVal($name,'model',$model);
|
||||||
@ -120,7 +123,7 @@ sub _fi2_Count() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 6. check if model is a scalar
|
# 6. check if model is a scalar
|
||||||
$model = $c_noModel if (ref $model);
|
$model = $c_noModel if (ref($model) eq 'HASH');
|
||||||
|
|
||||||
# 7. skip for some special cases found in database
|
# 7. skip for some special cases found in database
|
||||||
next if ( ($model =~ /^unkno.*/i) ||
|
next if ( ($model =~ /^unkno.*/i) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user