How do Repeat Buttons work?

Hi

I guess I’m missing something, but I cannot get repeating buttons to work. Basically I need to execute a script every second to get the status from my projector as I can only get it via the TCPClient and show it in a label.

I have currently a normal button which I press and there is a “clicked” event listener which then fires the script. I thought I could just change the button type to “Repeat” and set the repeat interval to 1000 miliseconds, but nothing is happening. Already tried all other Events, but none of them triggers my script function onChangeRequest().

Anything that I’m missing here?

Thanks

Repeat buttons fire the Clicked event only while pressed. Once you release the button it stops firing the event. They are typically used for Volume increase/decrease buttons.

You should send request for new status in onPoll. If you don’t wish to constantly poll, use the HasSubscribers function to check if your attribute has any active watchers.

Thanks a lot. That explains it. onPoll is the perfect solution.