day = datetime.datetime.today().isoweekday() - 1
day_of_week = day_to_string(day)
if self.is_include(day_of_week, dt_util.now()):
self._state = True
if self.is_exclude(day_of_week, dt_util.now()):
self._state = False
After Change
self._state = False
// Get iso day of the week (1 = Monday, 7 = Sunday)
date = datetime.today() + timedelta(days=self._days_offset)
day = date.isoweekday() - 1
day_of_week = day_to_string(day)
if self.is_include(day_of_week, date):