From 44ecb9380aef17238aedef8f737e268812e5d920 Mon Sep 17 00:00:00 2001
From: Risiko <>
Date: Wed, 12 Apr 2017 21:26:35 +0000
Subject: [PATCH] 98_weekprofile: update reading profile_count after save
 profiles

git-svn-id: https://svn.fhem.de/fhem/trunk@13979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
 fhem/CHANGED                | 1 +
 fhem/FHEM/98_weekprofile.pm | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fhem/CHANGED b/fhem/CHANGED
index 834ace0c1..741921d3d 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
 # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
 # Do not insert empty lines here, update check depends on it.
+  - update:  98_weekprofile: update reading profile_count after save profiles
   - feature: 98_weekprofile: new attribute widgetTranslations for translations
   - bugfix:  98_weekprofile: handle csrfToken
   - bugfix:  02_HTTPSRV: strip parameters from filename
diff --git a/fhem/FHEM/98_weekprofile.pm b/fhem/FHEM/98_weekprofile.pm
index a9151002b..b4552d469 100644
--- a/fhem/FHEM/98_weekprofile.pm
+++ b/fhem/FHEM/98_weekprofile.pm
@@ -669,7 +669,6 @@ sub weekprofile_Set($$@)
     $prfNew->{TOPIC} = $topic;
     
     push @{$hash->{PROFILES}}, $prfNew;
-    weekprofile_updateReadings($hash);
     weekprofile_writeProfilesToFile($hash);
     return undef;
   }
@@ -739,7 +738,6 @@ sub weekprofile_Set($$@)
       push @{$hash->{PROFILES}}, $prfDest;
     }
     weekprofile_writeProfilesToFile($hash);
-    weekprofile_updateReadings($hash);
     return undef;
   }
   
@@ -774,7 +772,6 @@ sub weekprofile_Set($$@)
       push @{$hash->{PROFILES}}, $prfDest;
     }
     weekprofile_writeProfilesToFile($hash);
-    weekprofile_updateReadings($hash);
     return undef;
   }
   
@@ -796,7 +793,6 @@ sub weekprofile_Set($$@)
     
     splice(@{$hash->{PROFILES}},$idx, 1);
     weekprofile_writeProfilesToFile($hash);
-    weekprofile_updateReadings($hash);
     return undef;
   }
   
@@ -949,6 +945,7 @@ sub weekprofile_writeProfilesToFile(@)
   }  
   close $fh;
   DoTrigger($me,"PROFILES_SAVED",1);
+  weekprofile_updateReadings($hash);
 }
 ############################################## 
 sub weekprofile_readProfilesFromFile(@)