Skip to content

Commit

Permalink
manage cache pour limiter le nombre d'appel...
Browse files Browse the repository at this point in the history
Attention, il faut 24h avant la prise en compte de cette fonctionnalité
  • Loading branch information
saniho committed Jun 29, 2021
1 parent 9e32774 commit d0e9bb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/apiEnedis/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Constants """

__VERSION__ = "1.3.0.2" # attention updater aussi manifest.json
__VERSION__ = "1.3.0.3" # attention updater aussi manifest.json
__name__ = "myEnedis"

try:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/apiEnedis/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "myEnedis sensor",
"documentation": "https://github.com/saniho/apiEnedis/",
"config_flow": true,
"version": "1.3.0.2",
"version": "1.3.0.3",
"requirements": [
],
"dependencies": [],
Expand Down
4 changes: 4 additions & 0 deletions custom_components/apiEnedis/myClientEnedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ def update(self):
self.getNbCall()))

except Exception as inst:
# pour eviter de boucler le call en permanence
if ( self._forceCallJson ):
self._forceCallJson = False
self.setDataJsonDefault({})
if (inst.args[:2] == (
"call", "error")): # gestion que c'est pas une erreur de contrat trop recent ?
log.error("%s - Erreur call ERROR %s" % (self.getContract().get_PDL_ID(), inst))
Expand Down

0 comments on commit d0e9bb5

Please sign in to comment.