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

lights as module #126

Open
markus2330 opened this issue Oct 26, 2023 · 1 comment
Open

lights as module #126

markus2330 opened this issue Oct 26, 2023 · 1 comment
Assignees

Comments

@markus2330
Copy link
Contributor

Hi,

what I actually wanted to change is the delay between switching on the different lights (if they are switched too fast, it creates electrical disturbance).

I stumbled upon handle_wrong_input, which I did not really understand, a comment there would be needed.

Looking further, I saw that the main logic for the buttons is now very nice&clear but the lights (and bell) logic is still in the old non-async way (which is very hard to read). So I was thinking that it probably makes more sense to rewrite that code to an extra async lights module, similar to how Garage works, which will maybe also let us get rid of hacks like handle_wrong_input?

Having a lights/enable would be a nice side-effect, as probably not every installation has lights at every entrance? @fel115 how about your situation? Can you maybe help out here?

@fel115
Copy link
Collaborator

fel115 commented Oct 28, 2023

I stumbled upon handle_wrong_input, which I did not really understand, a comment there would be needed.

I think the handle_wrong_input sets the buttons LEDs, if the input pin is wrong or a input timeout occurs.

Looking further, I saw that the main logic for the buttons is now very nice&clear but the lights (and bell) logic is still in the old non-async way (which is very hard to read). So I was thinking that it probably makes more sense to rewrite that code to an extra async lights module, similar to how Garage works, which will maybe also let us get rid of hacks like handle_wrong_input?

Yes, the idea was to do the reflector to async and then take a closer look into the modules, to remove non-async operations.

Having a lights/enable would be a nice side-effect, as probably not every installation has lights at every entrance? @fel115 how about your situation? Can you maybe help out here?

Yes I thinks so.

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

No branches or pull requests

2 participants