1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-07 22:29:19 +00:00

FHEMWEB: FW_visibleDevices from justme1968

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4910 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-02-13 15:25:58 +00:00
parent 5b9da7fa4a
commit e766463be4

View File

@ -42,6 +42,7 @@ sub FW_submit($$@);
sub FW_textfield($$$);
sub FW_textfieldv($$$$);
sub FW_updateHashes();
sub FW_visibleDevices(;$);
use vars qw($FW_dir); # base directory for web server
use vars qw($FW_icondir); # icon base directory
@ -72,6 +73,7 @@ use vars qw($FW_detail); # currently selected device for detail view
use vars qw($FW_cmdret); # Returned data by the fhem call
use vars qw($FW_room); # currently selected room
use vars qw($FW_formmethod);
use vars qw(%FW_visibleDeviceHash);
$FW_formmethod = "post";
@ -488,6 +490,7 @@ FW_answerCall($)
my %h = map { $_ => 1 } devspec2array($filter);
$me->{inform}{devices} = \%h;
%FW_visibleDeviceHash = FW_visibleDevices();
# NTFY_ORDER is larger than the normal order (50-)
$me->{NTFY_ORDER} = $FW_cname; # else notifyfn won't be called
@ -2370,6 +2373,27 @@ FW_textFieldFn($$$$)
# Widgets END
###########################
sub
FW_visibleDevices(;$)
{
my($FW_wname) = @_;
my %devices = ();
foreach my $d (sort keys %defs) {
next if(!defined($defs{$d}));
my $h = $defs{$d};
next if(!$h->{TEMPORARY});
next if($h->{TYPE} ne "FHEMWEB");
next if(defined($FW_wname) && $h->{SNAME} ne $FW_wname);
next if(!defined($h->{inform}));
@devices{ keys %{$h->{inform}->{devices}} } =
values %{$h->{inform}->{devices}};
}
return %devices;
}
sub
FW_ActivateInform()
{