fhemweb.pl converted to a FHEM module
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@141 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
34
webfrontend/pgm2/98_weblink.pm
Executable file
34
webfrontend/pgm2/98_weblink.pm
Executable file
@@ -0,0 +1,34 @@
|
||||
##############################################
|
||||
package main;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
#####################################
|
||||
sub
|
||||
weblink_Initialize($)
|
||||
{
|
||||
my ($hash) = @_;
|
||||
|
||||
$hash->{DefFn} = "weblink_Define";
|
||||
}
|
||||
|
||||
|
||||
#####################################
|
||||
sub
|
||||
weblink_Define($$)
|
||||
{
|
||||
my ($hash, $def) = @_;
|
||||
my ($type, $name, $wltype, $link) = split("[ \t]+", $def, 4);
|
||||
my %thash = ( link=>1, fileplot=>1 );
|
||||
|
||||
if(!$link || !$thash{$wltype}) {
|
||||
return "Usage: define <name> weblink [" . join("|",sort keys %thash) . "] <httplink>";
|
||||
}
|
||||
$hash->{WLTYPE} = $wltype;
|
||||
$hash->{LINK} = $link;
|
||||
$hash->{STATE} = "initial";
|
||||
return undef;
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user