diff --git a/fhem/FHEM/33_readingsGroup.pm b/fhem/FHEM/33_readingsGroup.pm
index 9b2a3193e..fb045a719 100644
--- a/fhem/FHEM/33_readingsGroup.pm
+++ b/fhem/FHEM/33_readingsGroup.pm
@@ -370,9 +370,9 @@ readingsGroup_makeLink($$$)
}
sub
-readingsGroup_2html($)
+readingsGroup_2html($;$)
{
- my($hash) = @_;
+ my($hash,$extPage) = @_;
$hash = $defs{$hash} if( ref($hash) ne 'HASH' );
return undef if( !$hash );
@@ -432,7 +432,9 @@ readingsGroup_2html($)
my $devices = $hash->{DEVICES};
- my $group = AttrVal( $d, "group", undef );
+ my $group;
+ $group = $extPage->{group} if( $extPage );
+ $group = AttrVal( $d, "group", undef ) if( !$group );
$group = "" if( !$group );
$group =~ s/,/_/g;
@@ -840,13 +842,13 @@ readingsGroup_2html($)
sub
readingsGroup_detailFn()
{
- my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
+ my ($FW_wname, $d, $room, $extPage) = @_; # extPage is set for summaryFn.
my $hash = $defs{$d};
$hash->{mayBeVisible} = 1;
- return readingsGroup_2html($d);
+ return readingsGroup_2html($d,$extPage);
}
sub
@@ -1081,7 +1083,7 @@ readingsGroup_Set($@)
{
my ($hash, $name, $cmd, $param, @a) = @_;
- my $list = "visibility:toggle,toggle2";
+ my $list = "visibility:toggle,toggle2,show,hide";
if( $cmd eq "refresh" ) {
readingsGroup_updateDevices($hash);
@@ -1258,6 +1260,14 @@ readingsGroup_Attr($$$;$)
Set
+ - hide
+ will hide all visible instances of this readingsGroup
+ - show
+ will show all visible instances of this readingsGroup
+ - toggle
+ will toggle the hidden/shown state of all visible instances of this readingsGroup
+ - toggle2
+ will toggle the expanded/collapsed state of all visible instances of this readingsGroup
@@ -1357,7 +1367,7 @@ readingsGroup_Attr($$$;$)
hidden -> default state is hidden but can be expanded
hideable -> default state is visible but can be hidden
- if set to collapsed or collapsible will recognise the specials <->,<+> and <+-> as the first elements of
+ if set to collapsed or collapsible will recognise the specials <->,<+> and <+-> as the first elements of
a line to add a + or - symbol to this line. clicking on the + or - symbol will toggle between expanded and collapsed state. if a readingsGroup is expanded then all others in the same group will be collapsed.
- -> line will be visible in expanded state
diff --git a/fhem/www/pgm2/fhemweb_readingsGroup.js b/fhem/www/pgm2/fhemweb_readingsGroup.js
index b4e607dee..6043751b0 100644
--- a/fhem/www/pgm2/fhemweb_readingsGroup.js
+++ b/fhem/www/pgm2/fhemweb_readingsGroup.js
@@ -19,6 +19,18 @@ FW_readingsGroupToggle(d) {
}
}
+function
+FW_readingsGroupShow(d,v) {
+ var rg = document.getElementById( 'readingsGroup-'+d );
+ if( rg ) {
+ s=rg.style;
+ if( s.display=='none' && v )
+ FW_readingsGroupToggle(d);
+ else if( s.display!='none' && !v )
+ FW_readingsGroupToggle(d);
+ }
+}
+
function
FW_readingsGroupToggle2(d) {
var rg = document.getElementById( 'readingsGroup-'+d );
@@ -64,15 +76,6 @@ FW_readingsGroupToggle2(d) {
}
}
-function
-FW_readingsGroupHide(d) {
-}
-
-function
-FW_readingsGroupShow(d) {
-}
-
-
function
FW_readingsGroupUpdateLine(d){
var dd = d[0].split("-", 3);
@@ -85,8 +88,10 @@ FW_readingsGroupUpdateLine(d){
if( d[1] == 'toggle' ) FW_readingsGroupToggle( dd[0] );
if( d[1] == 'toggle2' ) FW_readingsGroupToggle2( dd[0] );
+ if( d[1] == 'show' ) FW_readingsGroupShow( dd[0], 1 );
+ if( d[1] == 'hide' ) FW_readingsGroupShow( dd[0], 0 );
- console.log("xxx: "+d[1]);
+ //console.log("xxx: "+d[1]);
}
FW_widgets['readingsGroup'] = {