fix version state

This commit is contained in:
Marko Oldenburg 2019-06-19 23:25:01 +02:00
parent 01afe33c37
commit 9c0037d5db
2 changed files with 24 additions and 29 deletions

View File

@ -64,12 +64,11 @@ use strict;
use warnings; use warnings;
use POSIX; use POSIX;
use FHEM::Meta; use FHEM::Meta;
use GPUtils qw(GP_Import) use GPUtils qw(GP_Import);
; # wird für den Import der FHEM Funktionen aus der fhem.pl benötigt
use HttpUtils; use HttpUtils;
use TcpServerUtils; use TcpServerUtils;
our $MODULVERSION = '4.4.2';
our $FLOWSETVERSION = '4.4.1'; my $flowsetversion = '4.4.1';
my $missingModul = ''; my $missingModul = '';
eval "use Encode qw(encode encode_utf8);1" or $missingModul .= 'Encode '; eval "use Encode qw(encode encode_utf8);1" or $missingModul .= 'Encode ';
@ -192,6 +191,7 @@ sub _Export {
_Export( _Export(
qw( qw(
Initialize Initialize
Flowsetversion
) )
); );
@ -220,13 +220,6 @@ sub Initialize($) {
. 'fhemServerIP ' . 'fhemServerIP '
. $readingFnAttributes; . $readingFnAttributes;
foreach my $d ( sort keys %{ $modules{AMADCommBridge}{defptr} } ) {
my $hash = $modules{AMADCommBridge}{defptr}{$d};
$hash->{VERSIONMODUL} = $MODULVERSION;
$hash->{VERSIONFLOWSET} = $FLOWSETVERSION;
}
return FHEM::Meta::InitMod( __FILE__, $hash ); return FHEM::Meta::InitMod( __FILE__, $hash );
} }
@ -237,6 +230,8 @@ sub Define($$) {
my @a = split( '[ \t][ \t]*', $def ); my @a = split( '[ \t][ \t]*', $def );
return $@ unless ( FHEM::Meta::SetInternals($hash) ); return $@ unless ( FHEM::Meta::SetInternals($hash) );
use version 0.44; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
return 'too few parameters: define <name> AMADCommBridge <tcp-port>' return 'too few parameters: define <name> AMADCommBridge <tcp-port>'
if ( @a < 2 and @a > 3 ); if ( @a < 2 and @a > 3 );
return return
@ -253,8 +248,8 @@ sub Define($$) {
$hash->{BRIDGE} = 1; $hash->{BRIDGE} = 1;
$hash->{PORT} = $port; $hash->{PORT} = $port;
$hash->{VERSIONMODUL} = $MODULVERSION; $hash->{VERSION} = version->parse($VERSION)->normal;
$hash->{VERSIONFLOWSET} = $FLOWSETVERSION; $hash->{VERSIONFLOWSET} = $flowsetversion;
CommandAttr( undef, $name . ' room AMAD' ) CommandAttr( undef, $name . ' room AMAD' )
if ( AttrVal( $name, 'room', 'none' ) eq 'none' ); if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
@ -911,7 +906,7 @@ sub ProcessRead($$) {
if ( $data =~ /currentFlowsetUpdate.xml/ ) { if ( $data =~ /currentFlowsetUpdate.xml/ ) {
$response = $response =
qx(cat $fhempath/FHEM/lib/74_AMADautomagicFlowset_$FLOWSETVERSION.xml); qx(cat $fhempath/FHEM/lib/74_AMADautomagicFlowset_$flowsetversion.xml);
$c = $hash->{CD}; $c = $hash->{CD};
print $c "HTTP/1.1 200 OK\r\n", print $c "HTTP/1.1 200 OK\r\n",
"Content-Type: text/plain\r\n", "Content-Type: text/plain\r\n",
@ -925,7 +920,7 @@ qx(cat $fhempath/FHEM/lib/74_AMADautomagicFlowset_$FLOWSETVERSION.xml);
elsif ( $data =~ /currentTaskersetUpdate.prj.xml/ ) { elsif ( $data =~ /currentTaskersetUpdate.prj.xml/ ) {
$response = $response =
qx(cat $fhempath/FHEM/lib/74_AMADtaskerset_$FLOWSETVERSION.prj.xml); qx(cat $fhempath/FHEM/lib/74_AMADtaskerset_$flowsetversion.prj.xml);
$c = $hash->{CD}; $c = $hash->{CD};
print $c "HTTP/1.1 200 OK\r\n", print $c "HTTP/1.1 200 OK\r\n",
"Content-Type: text/plain\r\n", "Content-Type: text/plain\r\n",
@ -1291,6 +1286,10 @@ sub ParseMsg($$) {
return ( $msg, $tail ); return ( $msg, $tail );
} }
sub Flowsetversion() {
return $flowsetversion;
}
##### bleibt zu Anschauungszwecken erhalten ##### bleibt zu Anschauungszwecken erhalten
#sub Header2Hash($) { #sub Header2Hash($) {
# #
@ -1479,6 +1478,7 @@ sub ParseMsg($$) {
], ],
"release_status": "stable", "release_status": "stable",
"license": "GPL_2", "license": "GPL_2",
"version": "v4.4.2",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"
], ],

View File

@ -51,12 +51,10 @@ use strict;
use warnings; use warnings;
use POSIX; use POSIX;
use FHEM::Meta; use FHEM::Meta;
use Data::Dumper; #only for Debugging use Data::Dumper; #only for Debugging
use GPUtils qw(GP_Import) use GPUtils qw(GP_Import);
; # wird für den Import der FHEM Funktionen aus der fhem.pl benötigt
our $MODULVERSION = '4.4.2'; require FHEM::73_AMADCommBridge;
our $FLOWSETVERSION = '4.4.1';
my $missingModul = ''; my $missingModul = '';
eval "use Encode qw(encode encode_utf8);1" or $missingModul .= 'Encode '; eval "use Encode qw(encode encode_utf8);1" or $missingModul .= 'Encode ';
@ -154,6 +152,7 @@ BEGIN {
ReadingsVal ReadingsVal
IsDisabled IsDisabled
deviceEvents deviceEvents
AMADCommBridge_Flowsetversion
init_done init_done
gettimeofday gettimeofday
getUniqueId getUniqueId
@ -227,13 +226,6 @@ sub Initialize($) {
. 'setTakePictureCamera:Back,Front ' . 'setTakePictureCamera:Back,Front '
. $readingFnAttributes; . $readingFnAttributes;
foreach my $d ( sort keys %{ $modules{AMADDevice}{defptr} } ) {
my $hash = $modules{AMADDevice}{defptr}{$d};
$hash->{VERSIONMODUL} = $MODULVERSION;
$hash->{VERSIONFLOWSET} = $FLOWSETVERSION;
}
return FHEM::Meta::InitMod( __FILE__, $hash ); return FHEM::Meta::InitMod( __FILE__, $hash );
} }
@ -243,6 +235,8 @@ sub Define($$) {
my @a = split( '[ \t]+', $def ); my @a = split( '[ \t]+', $def );
return $@ unless ( FHEM::Meta::SetInternals($hash) ); return $@ unless ( FHEM::Meta::SetInternals($hash) );
use version 0.44; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
return return
'too few parameters: define <name> AMADDevice <HOST-IP> <amad_id> <remoteServer>' 'too few parameters: define <name> AMADDevice <HOST-IP> <amad_id> <remoteServer>'
if ( @a != 5 ); if ( @a != 5 );
@ -259,8 +253,8 @@ sub Define($$) {
$hash->{HOST} = $host; $hash->{HOST} = $host;
$hash->{AMAD_ID} = $amad_id; $hash->{AMAD_ID} = $amad_id;
$hash->{VERSIONMODUL} = $MODULVERSION; $hash->{VERSION} = version->parse($VERSION)->normal;
$hash->{VERSIONFLOWSET} = $FLOWSETVERSION; $hash->{VERSIONFLOWSET} = AMADCommBridge_Flowsetversion();
$hash->{NOTIFYDEV} = 'global,' . $name; $hash->{NOTIFYDEV} = 'global,' . $name;
$hash->{MODEL} = $remoteServer; $hash->{MODEL} = $remoteServer;
@ -1695,6 +1689,7 @@ sub CreateChangeBtDeviceValue($$) {
], ],
"release_status": "stable", "release_status": "stable",
"license": "GPL_2", "license": "GPL_2",
"version": "v4.4.2",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"
], ],