mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +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:
parent
ee62bef891
commit
216899c2da
@ -33,11 +33,6 @@ use warnings;
|
|||||||
use feature qw/say switch/;
|
use feature qw/say switch/;
|
||||||
use Time::HiRes qw(gettimeofday);
|
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($){
|
sub BBB_BMP180_Initialize($){
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
$hash->{DefFn} = "BBB_BMP180_Define";
|
$hash->{DefFn} = "BBB_BMP180_Define";
|
||||||
@ -45,6 +40,7 @@ sub BBB_BMP180_Initialize($){
|
|||||||
$hash->{GetFn} = "BBB_BMP180_Get";
|
$hash->{GetFn} = "BBB_BMP180_Get";
|
||||||
$hash->{AttrFn} = "BBB_BMP180_Attr";
|
$hash->{AttrFn} = "BBB_BMP180_Attr";
|
||||||
$hash->{NotifyFn} = "BBB_BMP180_Notify";
|
$hash->{NotifyFn} = "BBB_BMP180_Notify";
|
||||||
|
$hash->{ShutdoenFn} = "BBB_BMP180_Shutdown";
|
||||||
$hash->{AttrList} = "bbbRoundPressure:0,1 ".
|
$hash->{AttrList} = "bbbRoundPressure:0,1 ".
|
||||||
"bbbRoundTemperature:0,1 ".
|
"bbbRoundTemperature:0,1 ".
|
||||||
"bbbInterval ".
|
"bbbInterval ".
|
||||||
@ -83,6 +79,13 @@ sub BBB_BMP180_Undefine($$){
|
|||||||
return;
|
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($@){
|
sub BBB_BMP180_Get($@){
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
@ -38,13 +38,6 @@ use XML::Simple;
|
|||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
require LWP::UserAgent;
|
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,
|
my ($bulaList, $cmapList, %rmapList, $fmapList, %bula2bulaShort, %bulaShort2dwd, %dwd2Dir, %dwd2Name,
|
||||||
$alertsXml, %capCityHash, %capCellHash, $sList, $aList);
|
$alertsXml, %capCityHash, %capCellHash, $sList, $aList);
|
||||||
|
|
||||||
@ -66,6 +59,7 @@ sub GDS_Initialize($) {
|
|||||||
$hash->{UndefFn} = "GDS_Undef";
|
$hash->{UndefFn} = "GDS_Undef";
|
||||||
$hash->{GetFn} = "GDS_Get";
|
$hash->{GetFn} = "GDS_Get";
|
||||||
$hash->{SetFn} = "GDS_Set";
|
$hash->{SetFn} = "GDS_Set";
|
||||||
|
$hash->{ShutdownFn} = "GDS_Shutdown";
|
||||||
$hash->{AttrFn} = "GDS_Attr";
|
$hash->{AttrFn} = "GDS_Attr";
|
||||||
$hash->{AttrList} = "gdsFwName gdsFwType:0,1,2,3,4,5,6,7 ".
|
$hash->{AttrList} = "gdsFwName gdsFwType:0,1,2,3,4,5,6,7 ".
|
||||||
"gdsAll:0,1 gdsDebug:0,1 gdsLong:0,1 gdsPolygon:0,1 ".
|
"gdsAll:0,1 gdsDebug:0,1 gdsLong:0,1 gdsPolygon:0,1 ".
|
||||||
@ -143,6 +137,13 @@ sub GDS_Undef($$) {
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub GDS_Shutdown($) {
|
||||||
|
my ($hash) = @_;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
Log3 ($name,4,"GDS $name: shutdown requested");
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
sub GDS_Set($@) {
|
sub GDS_Set($@) {
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
@ -777,7 +778,7 @@ sub retrieveFile($$;$$$){
|
|||||||
eval {
|
eval {
|
||||||
$ftp = Net::FTP->new( "ftp-outgoing2.dwd.de",
|
$ftp = Net::FTP->new( "ftp-outgoing2.dwd.de",
|
||||||
Debug => 0,
|
Debug => 0,
|
||||||
Timeout => 360,
|
Timeout => 10,
|
||||||
FirewallType => $proxyType,
|
FirewallType => $proxyType,
|
||||||
Firewall => $proxyName);
|
Firewall => $proxyName);
|
||||||
if(defined($ftp)){
|
if(defined($ftp)){
|
||||||
@ -1082,6 +1083,9 @@ sub initDropdownLists($){
|
|||||||
#
|
#
|
||||||
# 2013-11-03 added error handling for malformed XML files from GDS
|
# 2013-11-03 added error handling for malformed XML files from GDS
|
||||||
#
|
#
|
||||||
|
# 2014-02-04 added ShutdownFn
|
||||||
|
# changed FTP Timeout
|
||||||
|
#
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
#
|
#
|
||||||
# Further informations
|
# Further informations
|
||||||
|
@ -70,6 +70,10 @@
|
|||||||
# Updated: commandref documentations
|
# Updated: commandref documentations
|
||||||
# internal help texts
|
# internal help texts
|
||||||
#
|
#
|
||||||
|
# 2014-02-04
|
||||||
|
# Added: ShutdownFn
|
||||||
|
# Changed: Undef will delete presence, too
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
@ -85,12 +89,6 @@ use MIME::Base64;
|
|||||||
use Time::HiRes qw(gettimeofday sleep usleep);
|
use Time::HiRes qw(gettimeofday sleep usleep);
|
||||||
use feature qw(say switch);
|
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_RCLayout();
|
||||||
sub HMT350_RCmakenotify($$);
|
sub HMT350_RCmakenotify($$);
|
||||||
|
|
||||||
@ -158,6 +156,7 @@ sub LISTENLIVE_Initialize($) {
|
|||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
$hash->{DefFn} = "LISTENLIVE_Define";
|
$hash->{DefFn} = "LISTENLIVE_Define";
|
||||||
$hash->{UndefFn} = "LISTENLIVE_Undefine";
|
$hash->{UndefFn} = "LISTENLIVE_Undefine";
|
||||||
|
$hash->{ShutdownFn} = "LISTENLIVE_Shutdown";
|
||||||
$hash->{AttrFn} = "LISTENLIVE_Attr";
|
$hash->{AttrFn} = "LISTENLIVE_Attr";
|
||||||
$hash->{SetFn} = "LISTENLIVE_Set";
|
$hash->{SetFn} = "LISTENLIVE_Set";
|
||||||
$hash->{GetFn} = "LISTENLIVE_Get";
|
$hash->{GetFn} = "LISTENLIVE_Get";
|
||||||
@ -231,10 +230,19 @@ sub LISTENLIVE_Define($$) {
|
|||||||
|
|
||||||
sub LISTENLIVE_Undefine($$) {
|
sub LISTENLIVE_Undefine($$) {
|
||||||
my($hash, $name) = @_;
|
my($hash, $name) = @_;
|
||||||
|
CommandDelete(undef, "pres_".$name);
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub LISTENLIVE_Shutdown($) {
|
||||||
|
my ($hash) = @_;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
Log3 ($name,4,"LISTENLIVE $name: shutdown requested");
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub LISTENLIVE_Attr($@) {
|
sub LISTENLIVE_Attr($@) {
|
||||||
my @a = @_;
|
my @a = @_;
|
||||||
my $hash = $defs{$a[1]};
|
my $hash = $defs{$a[1]};
|
||||||
|
@ -73,14 +73,6 @@ my $ua = LWP::UserAgent->new; # test
|
|||||||
$ua->timeout(10); # test
|
$ua->timeout(10); # test
|
||||||
$ua->env_proxy; # 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_abs2rel($$$);
|
||||||
sub OWO_isday($$);
|
sub OWO_isday($$);
|
||||||
|
|
||||||
@ -94,6 +86,7 @@ sub openweathermap_Initialize($) {
|
|||||||
$hash->{UndefFn} = "OWO_Undefine";
|
$hash->{UndefFn} = "OWO_Undefine";
|
||||||
$hash->{NotifyFn} = "OWO_Notify";
|
$hash->{NotifyFn} = "OWO_Notify";
|
||||||
$hash->{AttrFn} = "OWO_Attr";
|
$hash->{AttrFn} = "OWO_Attr";
|
||||||
|
$hash->{ShutdownFn} = "OWO_Shutdown";
|
||||||
|
|
||||||
$hash->{AttrList} = "do_not_notify:0,1 ".
|
$hash->{AttrList} = "do_not_notify:0,1 ".
|
||||||
"owoGetUrl owoSendUrl owoInterval:600,900,1800,3600 ".
|
"owoGetUrl owoSendUrl owoInterval:600,900,1800,3600 ".
|
||||||
@ -106,6 +99,13 @@ sub openweathermap_Initialize($) {
|
|||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub OWO_Shutdown($) {
|
||||||
|
my ($hash) = @_;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
Log3 ($name,4,"owo $name: shutdown requested");
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
sub OWO_Set($@){
|
sub OWO_Set($@){
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user