fix Meta Data Store #8

Merged
marko merged 1 commits from patch-VariableIsNotImported into dev 2023-01-04 18:34:35 +00:00
3 changed files with 8 additions and 14 deletions

View File

@ -362,7 +362,7 @@ __END__
=end html_DE =end html_DE
=for :application/json;q=META.json 70_Matrix.pm.pm =for :application/json;q=META.json 70_Matrix.pm
{ {
"abstract": "Provides a Matrix-Chatbot", "abstract": "Provides a Matrix-Chatbot",
"x_lang": { "x_lang": {
@ -391,7 +391,7 @@ __END__
"carp": 0, "carp": 0,
"POSIX": 0, "POSIX": 0,
"JSON::PP": 0, "JSON::PP": 0,
"encode": 0, "encode": 0
}, },
"recommends": { "recommends": {
"JSON": 0 "JSON": 0

View File

@ -1,2 +1,2 @@
UPD 2023-01-04_18:41:07 16959 FHEM/70_Matrix.pm UPD 2023-01-04_19:32:50 16955 FHEM/70_Matrix.pm
UPD 2023-01-04_19:01:30 51934 lib/FHEM/Devices/Matrix/Client.pm UPD 2023-01-04_19:32:46 51750 lib/FHEM/Devices/Matrix/Client.pm

View File

@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use HttpUtils; use HttpUtils;
use FHEM::Meta;
use JSON; use JSON;
use GPUtils qw(GP_Import); use GPUtils qw(GP_Import);
use FHEM::Core::Authentication::Passwords qw(:ALL); use FHEM::Core::Authentication::Passwords qw(:ALL);
@ -122,8 +123,9 @@ sub Define {
my $version; my $version;
return $@ unless ( FHEM::Meta::SetInternals($hash) ); return $@ unless ( FHEM::Meta::SetInternals($hash) );
$version = FHEM::Meta::Get( $hash, 'version' ); $version = FHEM::Meta::Get( $hash, 'version' );
use version 0.77; our $VERSION = $version; our $VERSION = $version;
return 'too few parameters: define <name> Matrix <server> <user>' return 'too few parameters: define <name> Matrix <server> <user>'
if ( scalar( @{$aArg} ) != 4 ); if ( scalar( @{$aArg} ) != 4 );
@ -133,7 +135,7 @@ sub Define {
$hash->{SERVER} = $aArg->[2]; # Internals sollten groß geschrieben werden $hash->{SERVER} = $aArg->[2]; # Internals sollten groß geschrieben werden
$hash->{URL} = 'https://' . $hash->{SERVER} . '/_matrix/client/'; $hash->{URL} = 'https://' . $hash->{SERVER} . '/_matrix/client/';
$hash->{USER} = $aArg->[3]; $hash->{USER} = $aArg->[3];
$hash->{VERSION} = $VERSION; $hash->{VERSION} = version->parse($VERSION)->normal;
$hash->{helper}->{passwdobj} = $hash->{helper}->{passwdobj} =
FHEM::Core::Authentication::Passwords->new( $hash->{TYPE} ); FHEM::Core::Authentication::Passwords->new( $hash->{TYPE} );
@ -177,14 +179,6 @@ sub _Init { # wir machen daraus eine privat function (CoolTux)
Log3( $name, 4, Log3( $name, 4,
"$name : Matrix::_Init $hash " . AttrVal( $name, 'matrixPoll', '-1' ) ); "$name : Matrix::_Init $hash " . AttrVal( $name, 'matrixPoll', '-1' ) );
# Update necessary?
Log3( $name, 1,
$name
. ': Start V'
. $hash->{VERSION} . ' -> V'
. FHEM::Meta::Get( $hash, 'version' ) )
if ( $hash->{VERSION} );
return ::readingsSingleUpdate( $hash, 'state', 'please set password first', return ::readingsSingleUpdate( $hash, 'state', 'please set password first',
1 ) 1 )
if ( if (