You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. When my PIRs triggers on same time, the timer reset to first time set. Example code in code section. In my opinion reset_timer function should always reset timer to delay time.
Version
4.4.2
Installation type
Docker container
Relevant log output
Start timer
(datetime.datetime(2023, 12, 28, 9, 49, 17, 752991), 0, {})
PIR1 trigger
(datetime.datetime(2023, 12, 28, 9, 49, 24, 752991), 0, {}) # Reset OK.
PIR2 trigger
(datetime.datetime(2023, 12, 28, 9, 49, 31, 752991), 0, {}) # Reset OK.
PIR1 and PIR2 trigger on same time
(datetime.datetime(2023, 12, 28, 9, 49, 17, 752991), 0, {}) # Reset to first time here.
Relevant code in the app or config file that caused the issue
import hassapi as hass
from time import sleep
class ResetTest(hass.Hass):
def light_off(self, kwargs):
# Off the light code.
print("Light off!", flush=True)
def initialize(self):
# Light off after 30 seconds after PIR1 or PIR2.# Start timer:
print("Start timer", flush=True)
timer = self.run_in(self.light_off, 30)
print(self.info_timer(timer), flush=True)
# After 7 seconds PIR1 triggered, reset timer:
sleep(7)
print("PIR1 trigger", flush=True)
self.reset_timer(timer)
print(self.info_timer(timer), flush=True)
# After 7 seconds PIR2 triggered, reset timer:
sleep(7)
print("PIR2 trigger", flush=True)
self.reset_timer(timer)
print(self.info_timer(timer), flush=True)
# After 5 seconds PIR1 and PIR2 triggered, double reset and error time:
sleep(5)
print("PIR1 and PIR2 trigger on same time", flush=True)
self.reset_timer(timer)
self.reset_timer(timer)
print(self.info_timer(timer), flush=True)
Anything else?
No response
The text was updated successfully, but these errors were encountered:
What happened?
Hello. When my PIRs triggers on same time, the timer reset to first time set. Example code in code section. In my opinion reset_timer function should always reset timer to delay time.
Version
4.4.2
Installation type
Docker container
Relevant log output
Relevant code in the app or config file that caused the issue
Anything else?
No response
The text was updated successfully, but these errors were encountered: