Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow switches to both be stateful and have a reset timer #18

Open
justjam2013 opened this issue Nov 17, 2024 · 2 comments
Open

Allow switches to both be stateful and have a reset timer #18

justjam2013 opened this issue Nov 17, 2024 · 2 comments
Labels
feature request New feature or request

Comments

@justjam2013
Copy link
Owner

justjam2013 commented Nov 17, 2024

Is your feature request related to a problem? Please describe:
I want to create switches with a reset timer and be stateful. For example, I create a switch with a reset delay of 1 hour. If Homebridge is restarted, when it restarts, it checks to see if the switch would have reset during the restart time.
If the switch would have reset, then set the switch state back to the reset value.
If the switch would not have reset, then determine how much time was left on the delay and set a new delay to turn off the switch.

Describe the solution you'd like:
When a stateful accessory is created with a reset timer, the start timestamp is saved. When Homebridge restarts, it checks the current time against the reset timer timestamp and creates a new delay timer with the remaining time. This may not be accurate to the millisecond, but should be accurate to the second.

@justjam2013 justjam2013 added the feature request New feature or request label Nov 17, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 20, 2024
@justjam2013 justjam2013 removed the stale label Dec 20, 2024
@justjam2013 justjam2013 changed the title Define an accessory as both stateful and have a reset timer Allow accessory to both be stateful and have a reset timer Jan 9, 2025
@justjam2013 justjam2013 changed the title Allow accessory to both be stateful and have a reset timer Allow switches to both be stateful and have a reset timer Jan 10, 2025
@CooperCGN
Copy link

That would be awesome. I have a switch with a timer running for 48 hours and I always have to make sure it’s not active before even doing simple things like updating the plugin itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants