change code of Initialize to FHEM::NUKIBridge for Meta Support

This commit is contained in:
2021-11-26 08:11:16 +01:00
parent a38d120a28
commit a612cdf1e4
2 changed files with 56 additions and 58 deletions

View File

@ -44,6 +44,37 @@ use FHEM::Meta;
require FHEM::Devices::Nuki::Bridge;
sub ::NUKIBridge_Initialize { goto &Initialize }
sub Initialize {
my ($hash) = @_;
# Provider
$hash->{WriteFn} = \&Write;
$hash->{Clients} = ':NUKIDevice:';
$hash->{MatchList} = { '1:NUKIDevice' => '^{.*}$' };
my $webhookFWinstance =
join( ",", ::devspec2array('TYPE=FHEMWEB:FILTER=TEMPORARY!=1') );
# Consumer
$hash->{SetFn} = \&FHEM::Devices::Nuki::Bridge::Set;
$hash->{GetFn} = \&FHEM::Devices::Nuki::Bridge::Get;
$hash->{DefFn} = \&FHEM::Devices::Nuki::Bridge::Define;
$hash->{UndefFn} = \&FHEM::Devices::Nuki::Bridge::Undef;
$hash->{NotifyFn} = \&FHEM::Devices::Nuki::Bridge::Notify;
$hash->{AttrFn} = \&FHEM::Devices::Nuki::Bridge::Attr;
$hash->{AttrList} =
'disable:1 '
. 'webhookFWinstance:'
. $webhookFWinstance . ' '
. 'webhookHttpHostname '
. $::readingFnAttributes;
return FHEM::Meta::InitMod( __FILE__, $hash );
}
1;
=pod