Skip to content
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

ConditionProperty where desired_state is the value of another parameter? #117

Open
bchen32 opened this issue Nov 21, 2024 · 3 comments
Open

Comments

@bchen32
Copy link

bchen32 commented Nov 21, 2024

If I have a primitive which takes in an int parameter x and an Element parameter y. Is there a way to create a post condition check that a property of y equals the value of x? From what I can tell, ConditionProperty only works to compare properties to hardcoded values but I wanted to check if I was missing something or if there was a workaround.

@matthias-mayr
Copy link
Member

Good question. Unfortunately this is currently not possible, but it would be a good thing to add.

The workaround that is definitely possible is to either incorporate this comparison inside the execute function of the existing primitive or to write a dedicated primitive skills that checks this.

@bchen32
Copy link
Author

bchen32 commented Nov 21, 2024

What I ended up doing was just adding another condition class that was essentially the same as ConditionProperty but uses a param_name instead of value.

@matthias-mayr
Copy link
Member

Ah yes, that of course works as well. I was just thinking about out-of-the-box solutions.

Feel free to make it nice and do a PR. I'll happily take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants