diff --git a/custom_components/chore_helper/config_flow.py b/custom_components/chore_helper/config_flow.py index ffb7a1e..a18483f 100644 --- a/custom_components/chore_helper/config_flow.py +++ b/custom_components/chore_helper/config_flow.py @@ -28,8 +28,12 @@ async def _validate_config( data[const.CONF_DAY_OF_MONTH] = None if const.CONF_DATE in data: - if data[const.CONF_DATE] == "0" or data[const.CONF_DATE] == "0/0": - data[const.CONF_DATE] = "" + if ( + data[const.CONF_DATE] == "0" + or data[const.CONF_DATE] == "0/0" + or data[const.CONF_DATE] == "" + ): + data[const.CONF_DATE] = None else: try: helpers.month_day_text(data[const.CONF_DATE]) diff --git a/custom_components/chore_helper/sensor.py b/custom_components/chore_helper/sensor.py index 2cff092..5decf6f 100644 --- a/custom_components/chore_helper/sensor.py +++ b/custom_components/chore_helper/sensor.py @@ -836,7 +836,7 @@ def _find_candidate_date(self, day1: date) -> date | None: start_date = self._calculate_schedule_start_date() day1 = self.calculate_day1(day1, start_date) conf_date = self._date - if conf_date is None: + if conf_date is None or conf_date == "": conf_date = start_date else: conf_date = datetime.strptime(conf_date, "%m/%d")