Skip to content

Commit

Permalink
addhistory sensor
Browse files Browse the repository at this point in the history
* total
* HC
* HP
sur l'avant veille et heure par heure
add sensor production en permanence, car impossible  determiner le type de PDL
correction valeur de history pour avoir en kWh
  • Loading branch information
saniho committed Feb 9, 2021
1 parent d679e09 commit 2db4c86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion custom_components/apiEnedis/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
DEFAULT_SCAN_INTERVAL_HISTORIQUE = 60*10 # 1 fois toutes les 10 minutes

HEURESCREUSES_ON = "heuresCreusesON"
__VERSION__ = "1.1.3.0RC6"
__VERSION__ = "1.1.3.0RC7"
__name__ = "myEnedis"

_consommation = "consommation"
Expand Down
9 changes: 0 additions & 9 deletions custom_components/apiEnedis/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ async def async_setup_entry(
myEnedis_Cordinator.myEnedis.initUpdate()
entities.append(myEnedisSensorCoordinator(myEnedis_Cordinator))
entities.append(myEnedisSensorYesterdayCostCoordinator(myEnedis_Cordinator))
#if (myEnedis_Cordinator.myEnedis._myDataEnedis.getContract() != None):
# # si on a eut le contrat et que le type du PDL est multiple, alors on fait un 2ème sensor
# if ( _production in myEnedis_Cordinator.myEnedis._myDataEnedis.getTypePDL() ):
# if ( _consommation in myEnedis_Cordinator.myEnedis._myDataEnedis.getTypePDL() ):
# entities.append(myEnedisSensorCoordinator(myEnedis_Cordinator, _production))
entities.append(myEnedisSensorCoordinator(myEnedis_Cordinator, _production))
entities.append(myEnedisSensorCoordinatorHistory(myEnedis_Cordinator, detail = "ALL" ))
entities.append(myEnedisSensorCoordinatorHistory(myEnedis_Cordinator, detail = "HC" ))
Expand Down Expand Up @@ -218,10 +213,6 @@ def update():
def _update_state(self):
"""Update sensors state."""
self._attributes = {ATTR_ATTRIBUTION: "" }
if ( self._typeSensor not in self._myDataEnedis.myEnedis._myDataEnedis.getTypePDL()):
# si quand on a cree le sensor, le contrat n'était pas dispo,
# alors on a pas créé le bon de type de sensor
self._typeSensor = self._myDataEnedis.myEnedis._myDataEnedis.getTypePDL()
status_counts, state = self._myDataEnedis.myEnedis.getStatus(self._typeSensor)
self._attributes.update(status_counts)
self._state = state
Expand Down

0 comments on commit 2db4c86

Please sign in to comment.