nickpourazima / rotary-phone-audio-guestbook

Audio guestbook using an old rotary phone and a raspberry pi zero
MIT License
64 stars 15 forks source link

Phones with NO hook_type have reverse hook actions #49

Closed jmdevita closed 3 months ago

jmdevita commented 3 months ago

I was building a rotary phone audio guestbook, and my device uses the NO hook type. However, even after changing the configuration to reflect this, the program launches into playing the message when the phone is docked, and stopping when the phone is removed from the dock.

I found that the issue is part of the setup_hook definition, where: self.hook.when_pressed = self.off_hook self.hook.when_released = self.on_hook

Need to be reversed when the hook_type is "NO". I'll submit a PR for this issue. This project was a life saver and was really exciting that something like this existed!

nickpourazima commented 3 months ago

Awesome, it's super helpful that you were able to test it out when operating as NO. Thanks for sorting that out!