Add slots to the StateMachine class (#95849)

This commit is contained in:
J. Nick Koston
2023-07-05 07:00:37 -05:00
committed by GitHub
parent 39dcb5a2b5
commit b2e708834f
5 changed files with 63 additions and 32 deletions

View File

@@ -1410,6 +1410,8 @@ class State:
class StateMachine:
"""Helper class that tracks the state of different entities."""
__slots__ = ("_states", "_reservations", "_bus", "_loop")
def __init__(self, bus: EventBus, loop: asyncio.events.AbstractEventLoop) -> None:
"""Initialize state machine."""
self._states: dict[str, State] = {}