project-alice-assistant / HermesLedControl

Provides an easy way to control your leds in an Hermes environment
GNU General Public License v3.0
83 stars 41 forks source link

Add timeout option #86

Closed Xenira closed 3 years ago

Xenira commented 3 years ago

Is your feature request related to a problem? Please describe. Sometimes the current animation gets stuck (not a problem of this project but with my rhasspy instance not sending the proper message / needing to be restarted etc.) on an animation. I would like to define a timeout after which the leds are switched off.

Describe the solution you'd like There should be an argument (maybe --timeout) which accepts a time in seconds after which idle or stop is called (not sure which one is correct.. Any state change resets this timer.

Describe alternatives you've considered I have considered adding a mqtt listener to send the required event should there be a missing deactivation. But integrating this here would be cleaner and more convenient.

Additional context Seems to be sometimes related to #63.

Xenira commented 3 years ago

I can implement the issues submitted by me. But I wanted your feedback first.

Psychokiller1888 commented 3 years ago

Hey, thanks for your input! Sure, I like the idea! Do not hesitate to clean up stuff, it's been a serious while I haven't touch HLC and it would need a serious refactoring.

Havning the timeout both as an option as your other ticket and as an argument would do it!

Xenira commented 3 years ago

Would idle or stop be correct? Ive seen that most patterns call stop inside idle.

Psychokiller1888 commented 3 years ago

Idle would call the idle animation, so that would be correct. If the idle animation is empty, then it stops