Version 2.0 Pre-Release #20

Merged
marko merged 29 commits from devel into main 2021-12-05 11:25:38 +00:00
Showing only changes of commit a38d120a28 - Show all commits

View File

@ -149,7 +149,7 @@ sub Initialize($) {
$hash->{MatchList} = { '1:NUKIDevice' => '^{.*}$' }; $hash->{MatchList} = { '1:NUKIDevice' => '^{.*}$' };
my $webhookFWinstance = my $webhookFWinstance =
join( ",", devspec2array('TYPE=FHEMWEB:FILTER=TEMPORARY!=1') ); join( ",", ::devspec2array('TYPE=FHEMWEB:FILTER=TEMPORARY!=1') );
# Consumer # Consumer
$hash->{SetFn} = \&Set; $hash->{SetFn} = \&Set;
@ -201,7 +201,7 @@ sub Define($$) {
::CommandAttr( undef, $name . ' room NUKI' ) ::CommandAttr( undef, $name . ' room NUKI' )
if ( ::AttrVal( $name, 'room', 'none' ) eq 'none' ); if ( ::AttrVal( $name, 'room', 'none' ) eq 'none' );
if ( ::addExtension( $name, 'NUKIBridge_CGI', $infix . "-" . $host ) ) { if ( addExtension( $name, 'NUKIBridge_CGI', $infix . "-" . $host ) ) {
$hash->{fhem}{infix} = $infix; $hash->{fhem}{infix} = $infix;
} }
@ -223,7 +223,7 @@ sub Undef($$) {
my $name = $hash->{NAME}; my $name = $hash->{NAME};
if ( defined( $hash->{fhem}{infix} ) ) { if ( defined( $hash->{fhem}{infix} ) ) {
::removeExtension( $hash->{fhem}{infix} ); removeExtension( $hash->{fhem}{infix} );
} }
::RemoveInternalTimer($hash); ::RemoveInternalTimer($hash);
@ -289,12 +289,14 @@ sub Attr(@) {
my $webhookHttpHostname = ( my $webhookHttpHostname = (
$attrName eq 'webhookHttpHostname' $attrName eq 'webhookHttpHostname'
&& defined($attrVal)
? $attrVal ? $attrVal
: ::AttrVal( $name, 'webhookHttpHostname', '' ) : ::AttrVal( $name, 'webhookHttpHostname', '' )
); );
my $webhookFWinstance = ( my $webhookFWinstance = (
$attrName eq 'webhookFWinstance' $attrName eq 'webhookFWinstance'
&& defined($attrVal)
? $attrVal ? $attrVal
: ::AttrVal( $name, 'webhookFWinstance', '' ) : ::AttrVal( $name, 'webhookFWinstance', '' )
); );
@ -442,7 +444,7 @@ sub Set($@) {
my $id = ( @args > 0 ? join( ' ', @args ) : 0 ); my $id = ( @args > 0 ? join( ' ', @args ) : 0 );
# Write( $hash, 'callback/remove', $id, undef, undef ) # Write( $hash, 'callback/remove', $id, undef, undef )
::Write( $hash, 'callback/remove', '{"param":"' . $id . '"}' ) Write( $hash, 'callback/remove', '{"param":"' . $id . '"}' )
if ( !::IsDisabled($name) ); if ( !::IsDisabled($name) );
return undef; return undef;
@ -455,7 +457,7 @@ sub Set($@) {
return ( 'Unknown argument ' . $cmd . ', choose one of ' . $list ); return ( 'Unknown argument ' . $cmd . ', choose one of ' . $list );
} }
::Write( $hash, $endpoint, undef ) Write( $hash, $endpoint, undef )
if ( !::IsDisabled($name) ); if ( !::IsDisabled($name) );
return; return;
@ -486,7 +488,7 @@ sub Get($@) {
return 'Unknown argument ' . $cmd . ', choose one of ' . $list; return 'Unknown argument ' . $cmd . ', choose one of ' . $list;
} }
return ::Write( $hash, $endpoint, undef ) return Write( $hash, $endpoint, undef )
} }
sub GetCheckBridgeAlive($) { sub GetCheckBridgeAlive($) {
@ -500,7 +502,7 @@ sub GetCheckBridgeAlive($) {
if ( !::IsDisabled($name) if ( !::IsDisabled($name)
&& $hash->{helper}->{iowrite} == 0 ) && $hash->{helper}->{iowrite} == 0 )
{ {
::Write( $hash, 'info', undef); Write( $hash, 'info', undef);
::Log3( $name, 4, "NUKIBridge ($name) - run Write" ); ::Log3( $name, 4, "NUKIBridge ($name) - run Write" );
} }
@ -518,7 +520,7 @@ sub FirstRun($) {
my $name = $hash->{NAME}; my $name = $hash->{NAME};
::RemoveInternalTimer($hash); ::RemoveInternalTimer($hash);
::Write( $hash, 'list', undef ) Write( $hash, 'list', undef )
if ( !::IsDisabled($name) ); if ( !::IsDisabled($name) );
return ::InternalTimer( gettimeofday() + 5, return ::InternalTimer( gettimeofday() + 5,
@ -658,7 +660,7 @@ sub Distribution($$$) {
my $dhash = $hash; my $dhash = $hash;
$dhash = $modules{NUKIDevice}{defptr}{ $param->{'nukiId'} } $dhash = $::modules{NUKIDevice}{defptr}{ $param->{'nukiId'} }
if ( defined( $param->{'nukiId'} ) ); if ( defined( $param->{'nukiId'} ) );
my $dname = $dhash->{NAME}; my $dname = $dhash->{NAME};