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

Refactor access-front-door #5

Merged
merged 8 commits into from
Jul 15, 2024
Merged

Conversation

North101
Copy link
Contributor

@North101 North101 commented Jun 29, 2024

  • Refactor access-front-door code
    • Fix typos
    • Reconnect wifi if disconnected
    • Don't error if request params don't exist
    • Convert duration to int
    • Moves env vars to a new file
    • Don't commit ssid and password
  • Add run.sh to copy files to the device and run main.py from command line
  • Update access-front-door/README.md
    • Add section on setting up environment variables
    • Add section on installing type hints in vs code
    • Add section copying and running code to the device from command line

Not tested

@North101 North101 force-pushed the main branch 4 times, most recently from 1c0ae01 to a3929dd Compare June 29, 2024 08:17
@North101 North101 force-pushed the main branch 2 times, most recently from cd77f40 to 1ad419f Compare June 30, 2024 11:54
Copy link
Member

@alistairjcbrown alistairjcbrown left a comment

Choose a reason for hiding this comment

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

This is awesome! I've used it as an opportunity to ask a bunch of questions and try and learn more about python/micropython!

access-front-door/src/lib/phew/__init__.py Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
if params.get('psk') != env.SHARED_PASSWORD:
return

duration = self.parse_duration(params.get("duration"))
Copy link
Member

Choose a reason for hiding this comment

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

Let's figure out how we want to pass parameters between nodes -- I think currently I've set it up so there's a special params parameter which would need additional parsing to extract duraction=X from the value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't 100% sure how you were doing it before, but to me it made sense to send it in a POST body. phew supports both json and form data.

access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/README.md Outdated Show resolved Hide resolved
access-front-door/README.md Show resolved Hide resolved
Copy link
Member

@alistairjcbrown alistairjcbrown left a comment

Choose a reason for hiding this comment

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

Got this running on the chip tonight and it works great! I bumped into a few issues, and that's this fresh wave of comments is from

access-front-door/README.md Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/README.md Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/src/main.py Outdated Show resolved Hide resolved
access-front-door/run.sh Outdated Show resolved Hide resolved
@alistairjcbrown alistairjcbrown merged commit d21e3fb into FarsetLabs:main Jul 15, 2024
1 check passed
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