mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 07:19:24 +00:00
35 lines
647 B
Perl
35 lines
647 B
Perl
|
##############################################
|
||
|
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;
|