Skip to content

Commit

Permalink
prevent repeat api calls after error
Browse files Browse the repository at this point in the history
ref #12
  • Loading branch information
pinkywafer authored Aug 30, 2020
1 parent 1509f37 commit a4f6f5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/calendarific/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_description(self,holiday_name):
def update(self):
if self._lastupdated == datetime.now().date():
return
self._lastupdated = datetime.now().date()
year = date.today().year
params = {'country': self._country,'year': year,'location': self._state}
calapi = calendarificAPI(self._api_key)
Expand All @@ -120,7 +121,6 @@ def update(self):
return
self._error_logged = False
self._next_holidays = response['response']['holidays']
self._lastupdated = datetime.now().date()
global holiday_list
holiday_list = []
for holiday in self._holidays:
Expand Down

0 comments on commit a4f6f5b

Please sign in to comment.