Skip to content

Commit

Permalink
erreur month
Browse files Browse the repository at this point in the history
integration de sonarQube( quality code )
modification valeur du yesterday
manage multi linky
  • Loading branch information
saniho committed Jan 15, 2021
1 parent 5ed6a0f commit 3d78e81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/apiEnedis/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
DEFAULT_SENSOR_INTERVAL = 60 # 60 secondes verifications du coordinator


__VERSION__ = "1.1.2.0alpha5"
__VERSION__ = "1.1.2.0RC"
__name__ = "myEnedis"
10 changes: 4 additions & 6 deletions custom_components/apiEnedis/myEnedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ def __init__(self, token, PDL_ID, delai=3600, heuresCreuses=None, \

self._joursHC = {}
self._joursHP = {}
if (log == None):
self._log = logging.getLogger(__nameMyEnedis__)
self._log.setLevel(logging.DEBUG)
else:
self._log = log
self._log = logging.getLogger(__nameMyEnedis__)

self._contentType = "application/json"
self._contentHedaerMyEnedis = 'home-assistant-myEnedis'
self._formatDateYmd = "%Y-%m-%d"
Expand Down Expand Up @@ -83,9 +80,10 @@ def get_PDL_ID(self):

def post_and_get_json(self, url, params=None, data=None, headers=None):
try:
import logging
import json
session = requests.Session()
#self.myLogWarning("params : %s " % (params))
#self.myLogWarning("data : %s " % (json.dumps(data)))
response = session.post(url, params=params, data=json.dumps(data), headers=headers, timeout=30)
response.raise_for_status()
return response.json()
Expand Down

0 comments on commit 3d78e81

Please sign in to comment.