Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
saniho committed Dec 2, 2024
1 parent 586e528 commit 3278173
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions .idea/workspace.xml

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

2 changes: 1 addition & 1 deletion custom_components/apiMareeInfo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def _update(self):
def extra_state_attributes(self):
"""Return the state attributes."""
return self._attributes
@property

@property
def device_state_attributes(self):
"""Return the state attributes."""
return self._attributes
Expand Down
4 changes: 2 additions & 2 deletions custom_components/apiMareeInfo/sensorApiMaree.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def getstatus(self):
maxTime = datetime.datetime.now() + datetime.timedelta(hours=self._myPort.getmaxhours())
dicoPrevis = []
for maDate in self._myPort.getprevis().keys():
if maDate.replace(tzinfo=None) >= datetime.datetime.now() and \
maDate.replace(tzinfo=None) <= maxTime:
if (maDate.replace(tzinfo=None) >= datetime.datetime.now() and
maDate.replace(tzinfo=None) <= maxTime):
dico = {}
dico["datetime"] = maDate
for clefPrevis in self._myPort.getprevis()[maDate].keys():
Expand Down
2 changes: 1 addition & 1 deletion testMareeInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ def testListePorts():

testPortMeteoMarine()
# testPortStormGlass()
#testListePorts()
# testListePorts()

0 comments on commit 3278173

Please sign in to comment.