pir_wait_for_stillness
Waits for a screen region to remain still for a set time, or times out—use to confirm animations settled or detect frozen UI.
Instructions
Block until consecutive samples have stayed below threshold for still_for_ms, or until timeout_ms. A short window means 'the page/animation has settled, safe to act'. A long window on something that should keep changing (a clock, a progress bar, a status bar) means it is frozen: still=true is then the alarm.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| metric | No | what the threshold applies to. rmse (default): the whole region moved. peak: any single cell moved, for a small thing that should tick inside a larger region (a clock in a bar). | |
| threshold | No | score that counts as a change, 0..1 (default 0.05). With metric=rmse a caret or cursor edge scores about 0.02 and a dialog opening 0.1+. With metric=peak a digit flipping in one cell scores about 0.05-0.2. | |
| timeout_ms | No | give up after this long (default 55000, max 540000) | |
| interval_ms | No | sampling period (default 500) | |
| still_for_ms | Yes | how long nothing may change |