# $Id$ package main; use strict; use warnings; use FHEM::Meta; sub search_Initialize($$) { my ($modHash) = @_; my %hash = ( Fn => "FHEM::search::run", Hlp => "", ); $cmds{search} = \%hash; return FHEM::Meta::InitMod( __FILE__, $modHash ); } # define package package FHEM::search; use strict; use warnings; use POSIX; use GPUtils qw(GP_Import); # Run before module compilation BEGIN { # Import from main:: GP_Import( qw( modules defs fhem ) ); } sub run { my ( $cl, $search ) = @_; my $hash; my $name = 'fhemInstaller'; if ( defined( $modules{Installer} ) && defined( $modules{Installer}{defptr} ) && defined( $modules{Installer}{defptr}{localhost} ) ) { $hash = $modules{Installer}{defptr}{localhost}; } else { my $no = 1; my $newname = $name; while ( defined( $defs{$newname} ) ) { $newname = $name . $no++; } fhem "define $newname Installer"; $hash = $modules{Installer}{defptr}{localhost}; } return 'Not a hash reference: ' unless ( $hash && ref($hash) eq 'HASH' ); $name = $hash->{NAME}; $hash->{CL} = $cl if ($cl); my $ret = FHEM::Installer::Get( $hash, $name, 'search', $search ); delete $hash->{CL} if ($cl); return $ret; } 1; =pod =encoding utf8 =item command =item summary Search through this FHEM instance =item summary_DE Durchsucht die FHEM Instanz =begin html

search

=end html =begin html_DE

search

=end html_DE =for :application/json;q=META.json 98_search.pm { "version": "v0.9.0", "author": [ "Julian Pawlowski " ], "x_fhem_maintainer": [ "loredo" ], "x_fhem_maintainer_github": [ "jpawlowski" ] } =end :application/json;q=META.json =cut