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

feat(hepa-uv): Add a task to handle the UV Ballast state based on external input #744

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented Jan 18, 2024

Overview

The HEPA/UV has a UV Ballast that needs to turn on/off based on external input, this pr adds a a task that actuates the UV ballast based on these external inputs. It also adds a timer that turns off the UV ballast after 15m.

Closes: RET-1402

Changes

  • Add a UVTask that listens for irq interrupts and turns on/off the UV Ballast accordingly
  • Turn off the HEPA fan and UV Ballast on startup

Review Requests

  • Does this approach make sense?
  • I'll have to go back in at some point to add a better interface instead of using gpio::set/reset directly
  • Feedback is appreciated!

@vegano1 vegano1 requested a review from sfoster1 January 18, 2024 19:46
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to track whether the ballast is currently active because otherwise we can start the timer multiple times with multiple presses


// set the UV Ballast
if (door_closed && reed_switch_set && uv_push_button) {
gpio::set(drive_pins.uv_on_off);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if i push the button twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We toggle the uv_push_button every time it's pressed on line 61.
Assuming the ballast is on and the timer is running, pressing the button again would turn it off and cancel the timer.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, didn't see the toggle. Looks good to me.

@vegano1 vegano1 merged commit 2809beb into main Jan 18, 2024
26 of 30 checks passed
@vegano1 vegano1 deleted the RET-1402_add_uv_task branch January 18, 2024 20:58
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

Successfully merging this pull request may close these issues.

2 participants