Code für Versionsnummer im Initilize umgeschrieben auf {AMAD}{defptr}

This commit is contained in:
Marko Oldenburg 2015-10-08 16:21:32 +02:00
parent 75837cf440
commit 3ac6de31f6

View File

@ -35,7 +35,7 @@ use Time::HiRes qw(gettimeofday);
use HttpUtils; use HttpUtils;
use TcpServerUtils; use TcpServerUtils;
my $version = "0.7.4"; my $version = "0.7.5";
@ -60,10 +60,12 @@ sub AMAD_Initialize($) {
"disable:1 "; "disable:1 ";
$hash->{AttrList} .= $readingFnAttributes; $hash->{AttrList} .= $readingFnAttributes;
foreach my $d(sort keys %defs) { foreach my $d(sort keys %{$modules{AMAD}{defptr}}) {
next if($defs{$d}{TYPE} ne "AMAD"); my $hash = $modules{AMAD}{defptr}{$d};
$defs{$d}->{VERSION} = $version; $hash->{VERSION} = $version;
} }
} }
sub AMAD_Define($$) { sub AMAD_Define($$) {
@ -107,8 +109,8 @@ sub AMAD_Define($$) {
readingsSingleUpdate ( $hash, "deviceState", "online", 1 ) if( $hash->{HOST} ); readingsSingleUpdate ( $hash, "deviceState", "online", 1 ) if( $hash->{HOST} );
InternalTimer( gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 0 ) if( $hash->{HOST} ); InternalTimer( gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 0 ) if( $hash->{HOST} );
$modules{AMAD}{defptr}{$hash->{HOST}}; $modules{AMAD}{defptr}{$hash->{HOST}} = $hash;
return undef; return undef;
} }