change code for versionflowset variable

This commit is contained in:
Marko Oldenburg
2019-06-20 11:22:10 +02:00
parent 9c0037d5db
commit abff40a4ec
2 changed files with 11 additions and 38 deletions

View File

@@ -52,9 +52,9 @@ use warnings;
use POSIX;
use FHEM::Meta;
use Data::Dumper; #only for Debugging
use GPUtils qw(GP_Import);
use GPUtils qw(GP_Import GP_Export);
require FHEM::73_AMADCommBridge;
require '73_AMADCommBridge.pm';
my $missingModul = '';
eval "use Encode qw(encode encode_utf8);1" or $missingModul .= 'Encode ';
@@ -165,19 +165,8 @@ BEGIN {
);
}
# _Export - Export references to main context using a different naming schema
sub _Export {
no strict qw/refs/; ## no critic
my $pkg = caller(0);
my $main = $pkg;
$main =~ s/^(?:.+::)?([^:]+)$/main::$1\_/g;
foreach (@_) {
*{ $main . $_ } = *{ $pkg . '::' . $_ };
}
}
#-- Export to main context with different name
_Export(
GP_Export(
qw(
Initialize
)
@@ -254,7 +243,6 @@ sub Define($$) {
$hash->{HOST} = $host;
$hash->{AMAD_ID} = $amad_id;
$hash->{VERSION} = version->parse($VERSION)->normal;
$hash->{VERSIONFLOWSET} = AMADCommBridge_Flowsetversion();
$hash->{NOTIFYDEV} = 'global,' . $name;
$hash->{MODEL} = $remoteServer;
@@ -288,6 +276,8 @@ sub Define($$) {
}
$iodev = $hash->{IODev}->{NAME};
# $hash->{VERSIONFLOWSET} = FHEM::Meta::Get( $defs{$iodev}, 'x_flowsetversion' );
$hash->{VERSIONFLOWSET} = $defs{$iodev}->{VERSIONFLOWSET};
my $d = $modules{AMADDevice}{defptr}{$amad_id};