From c7f2b073457d5fa56c5990c3f468c9ce80cc6624 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 4 Jan 2023 19:33:51 +0100 Subject: [PATCH] fix Meta Data Store --- FHEM/70_Matrix.pm | 4 ++-- controls_Matrix.txt | 4 ++-- lib/FHEM/Devices/Matrix/Client.pm | 14 ++++---------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/FHEM/70_Matrix.pm b/FHEM/70_Matrix.pm index 206bdac..39eea88 100644 --- a/FHEM/70_Matrix.pm +++ b/FHEM/70_Matrix.pm @@ -362,7 +362,7 @@ __END__ =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", "x_lang": { @@ -391,7 +391,7 @@ __END__ "carp": 0, "POSIX": 0, "JSON::PP": 0, - "encode": 0, + "encode": 0 }, "recommends": { "JSON": 0 diff --git a/controls_Matrix.txt b/controls_Matrix.txt index b9997e3..470e873 100644 --- a/controls_Matrix.txt +++ b/controls_Matrix.txt @@ -1,2 +1,2 @@ -UPD 2023-01-04_18:41:07 16959 FHEM/70_Matrix.pm -UPD 2023-01-04_19:01:30 51934 lib/FHEM/Devices/Matrix/Client.pm +UPD 2023-01-04_19:32:50 16955 FHEM/70_Matrix.pm +UPD 2023-01-04_19:32:46 51750 lib/FHEM/Devices/Matrix/Client.pm diff --git a/lib/FHEM/Devices/Matrix/Client.pm b/lib/FHEM/Devices/Matrix/Client.pm index 59b656c..dc097ba 100644 --- a/lib/FHEM/Devices/Matrix/Client.pm +++ b/lib/FHEM/Devices/Matrix/Client.pm @@ -16,6 +16,7 @@ use strict; use warnings; use HttpUtils; +use FHEM::Meta; use JSON; use GPUtils qw(GP_Import); use FHEM::Core::Authentication::Passwords qw(:ALL); @@ -122,8 +123,9 @@ sub Define { my $version; return $@ unless ( FHEM::Meta::SetInternals($hash) ); + $version = FHEM::Meta::Get( $hash, 'version' ); - use version 0.77; our $VERSION = $version; + our $VERSION = $version; return 'too few parameters: define Matrix ' if ( scalar( @{$aArg} ) != 4 ); @@ -133,7 +135,7 @@ sub Define { $hash->{SERVER} = $aArg->[2]; # Internals sollten groß geschrieben werden $hash->{URL} = 'https://' . $hash->{SERVER} . '/_matrix/client/'; $hash->{USER} = $aArg->[3]; - $hash->{VERSION} = $VERSION; + $hash->{VERSION} = version->parse($VERSION)->normal; $hash->{helper}->{passwdobj} = FHEM::Core::Authentication::Passwords->new( $hash->{TYPE} ); @@ -177,14 +179,6 @@ sub _Init { # wir machen daraus eine privat function (CoolTux) Log3( $name, 4, "$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', 1 ) if (