File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
custom_components/garbage_collection Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -487,7 +487,7 @@ async def _async_find_candidate_date(self, day1: date):
487487 for entity_id in self ._entities :
488488 entity = self .hass .data [DOMAIN ][SENSOR_PLATFORM ][entity_id ]
489489 d = await entity .async_next_date (day1 )
490- if candidate_date is None or d < candidate_date :
490+ if d is not None and ( candidate_date is None or d < candidate_date ) :
491491 candidate_date = d
492492 except KeyError :
493493 raise ValueError
@@ -641,8 +641,8 @@ async def _async_find_next_date(self, first_date: date):
641641 days = self ._offset
642642 )
643643 next_date = await self ._async_skip_holidays (next_date )
644- except ValueError :
645- raise
644+ except ( TypeError , ValueError ) :
645+ return None
646646 # Check if the date is within the range
647647 new_date = self .move_to_range (next_date )
648648 if new_date != next_date :
You can’t perform that action at this time.
0 commit comments