Skip to content

Commit

Permalink
Change variable name.
Browse files Browse the repository at this point in the history
STATES_ON and STATES_OFF are more in line with other variable names.
  • Loading branch information
denpamusic committed Oct 6, 2023
1 parent 63edaad commit 0c8292e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyplumio/helpers/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0c8292e

Please sign in to comment.