Skip to content

Commit

Permalink
bugfix state machine input as list
Browse files Browse the repository at this point in the history
  • Loading branch information
VigneshVSV committed Oct 23, 2024
1 parent 836b71f commit adffbfd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hololinked/server/state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from types import FunctionType, MethodType
from enum import EnumMeta, Enum, StrEnum

from ..param.parameterized import Parameterized
from ..param.parameterized import Parameterized, edit_constant
from .utils import getattr_without_descriptor_read
from .exceptions import StateMachineError
from .dataklasses import RemoteResourceInfoValidator
from .property import Property
from .properties import ClassSelector, TypedDict, Boolean
from .events import Event




Expand Down Expand Up @@ -86,8 +86,10 @@ def _prepare(self, owner : Parameterized) -> None:
owner_methods = [obj[0] for obj in inspect._getmembers(owner, inspect.ismethod, getattr_without_descriptor_read)]

if isinstance(self.states, list):
self.__class__.states.constant = False
self.states = tuple(self.states) # freeze the list of states

self.__class__.states.constant = True

# first validate machine
for state, objects in self.machine.items():
if state in self:
Expand Down

0 comments on commit adffbfd

Please sign in to comment.