1) Give a description of the problem
I have a piston that works fine. But I’m just curious to see if there’s a better way to handle this. I have a piston that makes an annoucement via Echo Speaks every 1 minute that the fridge door is open.
2) What is the expected behaviour?
I’d like to see if maybe there is a better way to do it than the way I’m doing it…for example, a while loop, but then have an “on break do this” condition. This doesn’t appear to exist, but I’m curious if there’s something I haven’t learned yet that could replicate that. I’ve basically implemented this myself by having the inverse logic that’s used in the while loop, but in a second block right after that cancels the pending announcement.
This is a fairly simple example. But I have more complex examples with While loops that have more complicated conditions where having an “on break” condition would be useful.
For example:
execute
while
FridgeDoor's contact stays open for 1 minute
do
Make a GET request
on break
do
Cancel all pending tasks;
end while
end execute
Here’s a little more complicated example…where it has two things to watch…motion, and contact…Same basic structure…while loop, with a block right after that has the inverse logic to cancel the pending tasks: