Skip to content

Accept NOT operator for State Machine members #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks
VigneshVSV opened this issue Jul 27, 2024 · 0 comments
Open
2 tasks

Accept NOT operator for State Machine members #26

VigneshVSV opened this issue Jul 27, 2024 · 0 comments
Labels
good first issue Good for newcomers intermediate intermediate level good first issues, might be little harder to complete

Comments

@VigneshVSV
Copy link
Collaborator

Currently, if an action or property write has to executed in all states except one, it must be specified for all those states. However, it would be better to specify it with NOT operator on the specific state where it must not be allowed.

state_machine = StateMachine(
        states=states,
        state1=[...], # ... means other actions and properties
        state2=[...,  not prop1],
        state3=[..., not action1],
        state4=[...]
    )

This should translate to not allowing action1 in state3, but allowing it in all other states.

Possible steps include

  • come up with a scheme how to carry over this metadata to the StateMachine object, it will mostly involve overriding the __bool__ operator
  • factor in logic in set_state() method
@VigneshVSV VigneshVSV added enhancement help wanted Extra attention/extra information is needed good first issue Good for newcomers labels Jul 27, 2024
@VigneshVSV VigneshVSV moved this to Backlog in hololinked Mar 1, 2025
@VigneshVSV VigneshVSV removed the status in hololinked Mar 1, 2025
@VigneshVSV VigneshVSV added the intermediate intermediate level good first issues, might be little harder to complete label Apr 6, 2025
@VigneshVSV VigneshVSV removed help wanted Extra attention/extra information is needed enhancement labels Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers intermediate intermediate level good first issues, might be little harder to complete
Projects
Status: No status
Development

No branches or pull requests

1 participant