From 92f91d97aeabbe55b9491807618110fdaaf6c04c Mon Sep 17 00:00:00 2001 From: Sailor <> Date: Sun, 1 Mar 2020 18:06:34 +0000 Subject: [PATCH] 73_ElectricityCalculator.pm: NotifyDev trigger fixed: notifyRegexpChanged git-svn-id: https://svn.fhem.de/fhem/trunk@21326 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/73_ElectricityCalculator.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/73_ElectricityCalculator.pm b/fhem/FHEM/73_ElectricityCalculator.pm index ccf5907c9..cd9f50dfd 100644 --- a/fhem/FHEM/73_ElectricityCalculator.pm +++ b/fhem/FHEM/73_ElectricityCalculator.pm @@ -121,8 +121,11 @@ sub ElectricityCalculator_Define($$$) $hash->{system}{DecimalPlace} = "%.3f"; } + ### For debugging purpose only + Log3 $name, 5, $name. " : ElectricityCalculator - RegEx : " . $RegEx; + ### Defining notify trigger - $hash->{NOTIFYDEV} = $RegEx; + notifyRegexpChanged($hash, $RegEx); ### Writing log entry Log3 $name, 5, $name. " : ElectricityCalculator - Starting to define module"; @@ -347,6 +350,9 @@ sub ElectricityCalculator_Notify($$) my $NumberOfChangedEvents = int(@{$ElectricityCountNameEvents}); my $RegEx = $ElectricityCalcDev->{REGEXP}; + ### For debugging purpose only + Log3 $ElectricityCalcName, 5, $ElectricityCalcName. " : ElectricityCalculator_Notify - Trigger Dev Name : " . $ElectricityCountDev->{NAME}; + ### Check whether the Electricity calculator has been disabled if(IsDisabled($ElectricityCalcName)) { @@ -447,7 +453,6 @@ sub ElectricityCalculator_Notify($$) Log3 $ElectricityCalcName, 3, $ElectricityCalcName. " : ElectricityCalculator - The attribute room was missing and has been set to Electric Energy Counter"; } } - if(!defined($attr{$ElectricityCalcName}{DecimalPlace})) { ### Set attribute with standard value since it is not available