diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm index 45d274003..6eb238409 100755 --- a/fhem/FHEM/00_CUL.pm +++ b/fhem/FHEM/00_CUL.pm @@ -379,8 +379,10 @@ CUL_Get($@) my $type = $hash->{TYPE}; return "\"get $type\" needs at least one parameter" if(@a < 2); - return "Unknown argument $a[1], choose one of " . join(" ", sort keys %gets) - if(!defined($gets{$a[1]})); + if(!defined($gets{$a[1]})) { + my @cList = map { $_ =~ m/^(file|raw)$/ ? $_ : "$_:noArg" } sort keys %gets; + return "Unknown argument $a[1], choose one of " . join(" ", @cList); + } my $arg = ($a[2] ? $a[2] : ""); my ($msg, $err); diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 95d80a56e..a3f260120 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -142,6 +142,7 @@ FHEMWEB_Initialize($) $data{webCmdFn}{slider} = "FW_sliderFn"; $data{webCmdFn}{timepicker} = "FW_timepickerFn"; + $data{webCmdFn}{noArg} = "FW_noArg"; $data{webCmdFn}{"~dropdown"}= "FW_dropdownFn"; # Should be the last } @@ -703,10 +704,11 @@ FW_makeTable($$$@) my($title, $name, $hash, $cmd) = (@_); return if(!$hash || !int(keys %{$hash})); + my $class = lc($title); + $class =~ s/[^A-Za-z]/_/g; + FW_pO "
"; FW_pO $title; - my $titleid = lc($title); - $titleid =~ s/[^A-Za-z]/_/g; - FW_pO ""; + FW_pO "
"; my $si = AttrVal("global", "showInternalValues", 0); my $row = 1; @@ -758,7 +760,7 @@ FW_makeTable($$$@) } elsif ($n eq "webCmd"){ my $lc = "detail=$name&cmd.$name=set $name"; - FW_pO ""; @@ -780,7 +782,7 @@ FW_makeTable($$$@) FW_pO ""; } FW_pO "
". + FW_pO "
". join(":", map {FW_pH("$lc $_",$_,0,"",1,1)} split(":",$val) ). "
"; - FW_pO "
"; + FW_pO "
"; } @@ -797,6 +799,7 @@ FW_makeSelect($$$$) $selEl = $1 if($list =~ m/([^ ]*):slider,/); # promote a slider if available $selEl = "room" if($list =~ m/room:/); + FW_pO "
"; FW_pO "
"; FW_pO FW_hidden("detail", $d); @@ -809,7 +812,7 @@ FW_makeSelect($$$$) # Initial setting FW_pO ""; - FW_pO "


"; + FW_pO "
"; } ############################## @@ -849,7 +852,7 @@ FW_doDetail($) FW_pO FW_hidden("detail", $d); FW_makeSelect($d, "set", getAllSets($d), "set"); - FW_makeSelect($d, "get", getAllGets($d), "set"); + FW_makeSelect($d, "get", getAllGets($d), "get"); FW_makeTable("Internals", $d, $h); FW_makeTable("Readings", $d, $h->{READINGS}); @@ -2670,6 +2673,15 @@ FW_sliderFn($$$$$) ""; } +sub +FW_noArg($$$$$) +{ + my ($FW_wname, $d, $FW_room, $cmd, $values) = @_; + + return undef if($values !~ m/^noArg$/); + return ""; +} + sub FW_timepickerFn() { @@ -3151,6 +3163,8 @@ FW_ActivateInform() If there it contains some known modifiers (colon, followed by a comma separated list), then a different widget will be displayed: