2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

39_gassistant: support npmjs module

git-svn-id: https://svn.fhem.de/fhem/trunk@18616 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dominikkarall 2019-02-17 08:50:02 +00:00
parent fc907cb0aa
commit 9ef4f45234

View File

@ -84,7 +84,7 @@ gassistant_Define($$)
gassistant_AttrDefaults($hash);
$hash->{NOTIFYDEV} = "global";
$hash->{NOTIFYDEV} = "global,global:npmjs.*gassistant-fhem.*";
if( $attr{global}{logdir} ) {
CommandAttr(undef, "$name gassistantFHEM-log %L/gassistant-%Y-%m-%d.log") if( !AttrVal($name, 'gassistantFHEM-log', undef ) );
@ -120,9 +120,19 @@ gassistant_Notify($$)
my ($hash,$dev) = @_;
return if($dev->{NAME} ne "global");
return if(!grep(m/^INITIALIZED|REREADCFG$/, @{$dev->{CHANGED}}));
if( grep(m/^npmjs:BEGIN.*gassistant-fhem.*/, @{$dev->{CHANGED}}) ) {
CoProcess::stop($hash);
return undef;
} elsif( grep(m/^npmjs:FINISH.*gassistant-fhem.*/, @{$dev->{CHANGED}}) ) {
CoProcess::start($hash);
return undef;
} elsif( grep(m/^INITIALIZED|REREADCFG$/, @{$dev->{CHANGED}}) ) {
CoProcess::start($hash);
return undef;
}
return undef;
}