2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-18 05:56:03 +00:00

added: ShutdownFn

fixed: minor bugs

git-svn-id: https://svn.fhem.de/fhem/trunk@4808 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2014-02-04 17:09:26 +00:00
parent ee62bef891
commit 216899c2da
4 changed files with 42 additions and 27 deletions

View File

@ -33,11 +33,6 @@ use warnings;
use feature qw/say switch/;
use Time::HiRes qw(gettimeofday);
sub BBB_BMP180_Define($$);
sub BBB_BMP180_Undefine($$);
sub BBB_BMP180_Get($@);
sub BBB_BMP180_Notify($$);
sub BBB_BMP180_Initialize($){
my ($hash) = @_;
$hash->{DefFn} = "BBB_BMP180_Define";
@ -45,6 +40,7 @@ sub BBB_BMP180_Initialize($){
$hash->{GetFn} = "BBB_BMP180_Get";
$hash->{AttrFn} = "BBB_BMP180_Attr";
$hash->{NotifyFn} = "BBB_BMP180_Notify";
$hash->{ShutdoenFn} = "BBB_BMP180_Shutdown";
$hash->{AttrList} = "bbbRoundPressure:0,1 ".
"bbbRoundTemperature:0,1 ".
"bbbInterval ".
@ -83,6 +79,13 @@ sub BBB_BMP180_Undefine($$){
return;
}
sub BBB_BMP180_Shutdown($) {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 ($name,4,"BBB_BMP180 $name: shutdown requested");
return undef;
}
sub BBB_BMP180_Get($@){
my ($hash, @a) = @_;
my $name = $hash->{NAME};

View File

@ -38,13 +38,6 @@ use XML::Simple;
use HttpUtils;
require LWP::UserAgent;
sub GDS_Define($$$);
sub GDS_Undef($$);
sub GDS_Set($@);
sub GDS_Get($@);
sub GDS_Attr(@);
my ($bulaList, $cmapList, %rmapList, $fmapList, %bula2bulaShort, %bulaShort2dwd, %dwd2Dir, %dwd2Name,
$alertsXml, %capCityHash, %capCellHash, $sList, $aList);
@ -66,6 +59,7 @@ sub GDS_Initialize($) {
$hash->{UndefFn} = "GDS_Undef";
$hash->{GetFn} = "GDS_Get";
$hash->{SetFn} = "GDS_Set";
$hash->{ShutdownFn} = "GDS_Shutdown";
$hash->{AttrFn} = "GDS_Attr";
$hash->{AttrList} = "gdsFwName gdsFwType:0,1,2,3,4,5,6,7 ".
"gdsAll:0,1 gdsDebug:0,1 gdsLong:0,1 gdsPolygon:0,1 ".
@ -143,6 +137,13 @@ sub GDS_Undef($$) {
return undef;
}
sub GDS_Shutdown($) {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 ($name,4,"GDS $name: shutdown requested");
return undef;
}
sub GDS_Set($@) {
my ($hash, @a) = @_;
my $name = $hash->{NAME};
@ -777,7 +778,7 @@ sub retrieveFile($$;$$$){
eval {
$ftp = Net::FTP->new( "ftp-outgoing2.dwd.de",
Debug => 0,
Timeout => 360,
Timeout => 10,
FirewallType => $proxyType,
Firewall => $proxyName);
if(defined($ftp)){
@ -1082,6 +1083,9 @@ sub initDropdownLists($){
#
# 2013-11-03 added error handling for malformed XML files from GDS
#
# 2014-02-04 added ShutdownFn
# changed FTP Timeout
#
####################################################################################################
#
# Further informations

View File

@ -70,6 +70,10 @@
# Updated: commandref documentations
# internal help texts
#
# 2014-02-04
# Added: ShutdownFn
# Changed: Undef will delete presence, too
#
##############################################################################
package main;
@ -85,12 +89,6 @@ use MIME::Base64;
use Time::HiRes qw(gettimeofday sleep usleep);
use feature qw(say switch);
sub LISTENLIVE_Set($@);
sub LISTENLIVE_Get($@);
sub LISTENLIVE_Define($$);
sub LISTENLIVE_GetStatus($;$);
sub LISTENLIVE_Undefine($$);
sub HMT350_RCLayout();
sub HMT350_RCmakenotify($$);
@ -158,6 +156,7 @@ sub LISTENLIVE_Initialize($) {
my ($hash) = @_;
$hash->{DefFn} = "LISTENLIVE_Define";
$hash->{UndefFn} = "LISTENLIVE_Undefine";
$hash->{ShutdownFn} = "LISTENLIVE_Shutdown";
$hash->{AttrFn} = "LISTENLIVE_Attr";
$hash->{SetFn} = "LISTENLIVE_Set";
$hash->{GetFn} = "LISTENLIVE_Get";
@ -231,10 +230,19 @@ sub LISTENLIVE_Define($$) {
sub LISTENLIVE_Undefine($$) {
my($hash, $name) = @_;
CommandDelete(undef, "pres_".$name);
RemoveInternalTimer($hash);
return undef;
}
sub LISTENLIVE_Shutdown($) {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 ($name,4,"LISTENLIVE $name: shutdown requested");
return undef;
}
sub LISTENLIVE_Attr($@) {
my @a = @_;
my $hash = $defs{$a[1]};

View File

@ -73,14 +73,6 @@ my $ua = LWP::UserAgent->new; # test
$ua->timeout(10); # test
$ua->env_proxy; # test
sub OWO_Set($@);
sub OWO_Get($@);
sub OWO_Attr(@);
sub OWO_Notify($$);
sub OWO_Define($$);
sub OWO_GetStatus($;$);
sub OWO_Undefine($$);
sub OWO_abs2rel($$$);
sub OWO_isday($$);
@ -94,6 +86,7 @@ sub openweathermap_Initialize($) {
$hash->{UndefFn} = "OWO_Undefine";
$hash->{NotifyFn} = "OWO_Notify";
$hash->{AttrFn} = "OWO_Attr";
$hash->{ShutdownFn} = "OWO_Shutdown";
$hash->{AttrList} = "do_not_notify:0,1 ".
"owoGetUrl owoSendUrl owoInterval:600,900,1800,3600 ".
@ -106,6 +99,13 @@ sub openweathermap_Initialize($) {
$readingFnAttributes;
}
sub OWO_Shutdown($) {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 ($name,4,"owo $name: shutdown requested");
return undef;
}
sub OWO_Set($@){
my ($hash, @a) = @_;
my $name = $hash->{NAME};