diff --git a/fhem/CHANGED b/fhem/CHANGED index 4aab767f6..7b3f80253 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 01_FHEMWEB: Dump "Probably associated with" in Raw definition - bugfix: 93_DbRep: added balance diff to diffValue, balance diff to next period if value is 0 between two periods with values are set diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index f5db0c3e0..f749b052c 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -1260,17 +1260,7 @@ FW_doDetail($) FW_pO FW_detailSelect($d, "attr", $attrList); FW_makeTable("Attributes", $d, $attr{$d}, "deleteattr"); - ## dependent objects - my @dob; # dependent objects - triggered by current device - foreach my $dn (sort keys %defs) { - next if(!$dn || $dn eq $d); - my $dh = $defs{$dn}; - if(($dh->{DEF} && $dh->{DEF} =~ m/\b$d\b/) || - ($h->{DEF} && $h->{DEF} =~ m/\b$dn\b/)) { - push(@dob, $dn); - } - } - FW_makeTableFromArray("Probably associated with", "assoc", @dob,); + FW_makeTableFromArray("Probably associated with", "assoc", getPawList($d)); FW_pO ""; @@ -1278,7 +1268,7 @@ FW_doDetail($) FW_pH "cmd=style iconFor $d", "Select icon", undef, "detLink iconFor"; FW_pH "cmd=style showDSI $d", "Extend devStateIcon", undef, "detLink showDSI"; - FW_pH "cmd=rawDef $d", "Raw defintion", undef, "detLink rawDef"; + FW_pH "cmd=rawDef $d", "Raw definition", undef, "detLink rawDef"; FW_pH "cmd=delete $d", "Delete this device ($d)", undef, "detLink delDev" if($d ne "global"); my $sfx = AttrVal("global", "language", "EN"); diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index 24da576c7..d62fb35dc 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -888,7 +888,7 @@ The following local attributes are used by a wider range of devices: diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html index ac9151e7b..d9b416a72 100644 --- a/fhem/docs/commandref_frame_DE.html +++ b/fhem/docs/commandref_frame_DE.html @@ -937,7 +937,7 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet: diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 0ad34f4c5..6960c5ec5 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -114,6 +114,7 @@ sub fhemTzOffset($); sub getAllAttr($); sub getAllGets($); sub getAllSets($); +sub getPawList($); sub getUniqueId(); sub latin1ToUtf8($); sub myrename($$$); @@ -2187,9 +2188,17 @@ CommandList($$) my ($cl, $param) = @_; my $str = ""; - if($param =~ m/^-r *(.*)$/) { - my @list = devspec2array($1 ? $1 : ".*", $cl); - foreach my $d (sort @list) { + if($param =~ m/^-r *(.*)$/i) { + my @list; + my $arg = $1; + if($param =~ m/^-R/) { + return "-R needs a valid device as argument" if(!$arg); + push @list, $arg; + push @list, getPawList($arg); + } else { + @list = devspec2array($arg ? $arg : ".*", $cl); + } + foreach my $d (@list) { return "No device named $d found" if(!defined($defs{$d})); $str .= "\n" if($str); my @a = GetDefAndAttr($d); @@ -4802,7 +4811,7 @@ parseParams($;$) $value =~ s/^.(.*).$/$1/; } - #collext all parts until opening { and closing } are matched + #collect all parts until opening { and closing } are matched if( $value =~ m/^{/ ) { # } for match my $count = 0; for my $i (0..length($value)-1) { @@ -4835,5 +4844,22 @@ parseParams($;$) return(\@a, \%h); } +# get "Porbably Associated With" list for a devicename +sub +getPawList($) +{ + my ($d) = @_; + my $h = $defs{$d}; + my @dob; + foreach my $dn (sort keys %defs) { + next if(!$dn || $dn eq $d); + my $dh = $defs{$dn}; + if(($dh->{DEF} && $dh->{DEF} =~ m/\b$d\b/) || + ($h->{DEF} && $h->{DEF} =~ m/\b$dn\b/)) { + push(@dob, $dn); + } + } + return @dob; +} 1; diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index dc74d82aa..c21fef61c 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -602,23 +602,32 @@ FW_rawDef() $("#content").append('
'+ '