appdaemon icon indicating copy to clipboard operation
appdaemon copied to clipboard

run_every does not respect constrain_input_boolean

Open gpbenton opened this issue 7 months ago • 1 comments

What happened?

Using constrain_input_boolean=input_boolean.waste_needs_moving as a parameter to run_every should stop the callback from running until the input_boolean is switched to on.

On 4.5.11 this does not happen, and the callback gets called no matter what the state of the input_boolean. Looking at the log, it seems to use constrain_input_boolean as an optional parameter.

Version

4.5.11

Installation type

Docker container

Relevant log output

2025-06-26 13:42:37.443423 DEBUG waste_reminder: initialize
2025-06-26 13:42:37.444330 DEBUG waste_reminder: Registering reminder for run_every in 0:00:11 intervals, starting 2025-06-26 13:42:48.444172+01:00
2025-06-26 13:42:48.448297 DEBUG waste_reminder: reminder
2025-06-26 13:42:48.449176 DEBUG waste_reminder: kwargs={'__thread_id': 'thread-23', 'constrain_input_boolean': 'input_boolean.waste_needs_moving'}
2025-

Relevant code in the app or config file that caused the issue

self.timer_handle = self.run_every(
            self.reminder,
            "now",
            self.delay,
            constrain_input_boolean=self.args["sensor"],
        )

Anything else?

This is the same callback as issue #2385 so the two might be related.

gpbenton avatar Jun 26 '25 12:06 gpbenton

run_at_sunset has the same issue. Also, self.run_daily doesn't respect constrain_input_select. I would assume these are all tied together.

bertonjit avatar Nov 08 '25 14:11 bertonjit