Skip to content

Commit

Permalink
gestion pas d'hoaire defini coté enedis
Browse files Browse the repository at this point in the history
et pas d'horaire coté sensor...
  • Loading branch information
saniho committed Jan 21, 2021
1 parent 0ada1e8 commit 3473af0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .scannerwork/report-task.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ projectKey=saniho:apienedi
serverUrl=http://192.168.1.93:9000
serverVersion=8.6.0.39681
dashboardUrl=http://192.168.1.93:9000/dashboard?id=saniho%3Aapienedi
ceTaskId=AXchhwzzTRDQjAtxtmrN
ceTaskUrl=http://192.168.1.93:9000/api/ce/task?id=AXchhwzzTRDQjAtxtmrN
ceTaskId=AXchxEjfTRDQjAtxtmrO
ceTaskUrl=http://192.168.1.93:9000/api/ce/task?id=AXchxEjfTRDQjAtxtmrO
2 changes: 2 additions & 0 deletions custom_components/apiEnedis/myEnedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ def getContractData(self, contract, clef, defaultValue):

def analyseValueContract(self, data):
contract = None
print(data)
print("***")
if data != None: # si une valeur
for x in data['customer']['usage_points']:
if str(x["usage_point"]['usage_point_id']) == self._PDL_ID:
Expand Down
11 changes: 8 additions & 3 deletions custom_components/apiEnedis/testEnedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def testMulti():
#for qui in ["ENEDIS19"]:
#for qui in ["ENEDIS"]:
#for qui in ["ENEDIS21"]:
for qui in ["ENEDIS22"]:
for qui in ["ENEDIS25","ENEDIS", ]:
token = mon_conteneur[qui]['TOKEN']
PDL_ID = mon_conteneur[qui]['CODE']
#print(qui , "*", token, PDL_ID)
Expand All @@ -113,12 +113,17 @@ def testMulti():
myDataEnedis.updateHCHP()
print("myDataEnedis.getContract() : ", myDataEnedis.getContract())
print("myDataEnedis.getHeuresCreuses() : ", myDataEnedis.getHeuresCreuses())

myDataEnedis.updateYesterday()
print("cnosommation : %s" %myDataEnedis.getYesterday() )
myDataEnedis.updateProductionYesterday()
print("production : %s" %myDataEnedis.getProductionYesterday() )
#myDataEnedis.updateLastYear()

# myDataEnedis._serverName = "http://localhost:5500" # pour mockserver
# myDataEnedis._serverName = "http://localhost:5501" # pour record
myDataEnedis.updateDataYesterdayHCHP()
testComplet( myDataEnedis )
#myDataEnedis.updateDataYesterdayHCHP()
#testComplet( myDataEnedis )
print("***")
print( myDataEnedis.getLastMethodCallError())
print( myDataEnedis.getLastAnswer())
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ sonar.projectName=apienedi
sonar.projectVersion=1.0
sonar.projectBaseDir=C:/Projets/apiEnedis/
sonar.sources=C:/Projets/apiEnedis/
sonar.python.coverage.reportPath=C:/Projets/apiEnedis/tests/results/coverage.xml

sonar.host.url=http://192.168.1.93:9000

Expand Down
2 changes: 0 additions & 2 deletions tests/test_messages.py

This file was deleted.

8 changes: 8 additions & 0 deletions tests/test_myEnedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,11 @@ def test_horaire_surcharge():
dataCompare = hc
assert myE._heuresCreuses == dataCompare, "erreur format HC/HP"

def test_get_message():
pass
#assert False == False, "message errone"

def test_get_init():
from custom_components.apiEnedis import sensorEnedis
se = sensorEnedis.manageSensorState()
assert se.getInit() == False, "not False !! "
6 changes: 0 additions & 6 deletions tests/test_sensorEnedis.py

This file was deleted.

0 comments on commit 3473af0

Please sign in to comment.