diff --git a/pyplumio/helpers/schedule.py b/pyplumio/helpers/schedule.py index 0f1d4133..02de9f12 100644 --- a/pyplumio/helpers/schedule.py +++ b/pyplumio/helpers/schedule.py @@ -19,12 +19,12 @@ STATE_NIGHT: Final = "night" STATE_DAY: Final = "day" -ENABLED: Final[list[str]] = [ +STATES_ON: Final[list[str]] = [ STATE_ON, STATE_DAY, ] -DISABLED: Final[list[str]] = [ +STATES_OFF: Final[list[str]] = [ STATE_OFF, STATE_NIGHT, ] @@ -92,12 +92,12 @@ def set_state( end: str = END_OF_DAY, ) -> None: """Set state for interval.""" - if state not in [*ENABLED, *DISABLED]: + if state not in [*STATES_ON, *STATES_OFF]: raise ValueError(f'state "{state}" is not allowed') index, stop_index = _parse_interval(start, end) while index < stop_index: - self._intervals[index] = state in ENABLED + self._intervals[index] = state in STATES_ON index += 1 def set_on(self, start: str = START_OF_DAY, end: str = END_OF_DAY) -> None: