Skip to content

Commit

Permalink
ajout limitation nombre d'heure de prevision
Browse files Browse the repository at this point in the history
  • Loading branch information
saniho committed Mar 14, 2024
1 parent df66477 commit 6b1307b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion custom_components/apiMareeInfo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def __init__(self, idDuPort, lat, lng, stormkey, maxhours, _update_interval):
self._lng = lng
self._origine = "MeteoMarine"
self._stormkey = stormkey
if ( maxhours is None): maxhours = 6
self._maxhours = maxhours
self._myMaree = apiMareeInfo.ApiMareeInfo()
pass
Expand Down Expand Up @@ -95,6 +94,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
except:
_LOGGER.exception("Could not run my apiMaree Extension miss argument ?")
return False
if maxhours is None:
maxhours = 6
else:
maxhours = int( maxhours )
myPort = myMareeInfo(idDuPort, lat, lng, stormkey, maxhours, update_interval_http)
myPort.update()
add_entities([infoMareeSensor(session, name, update_interval, myPort)], True)
Expand Down

0 comments on commit 6b1307b

Please sign in to comment.