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

SMIBHID has a webserver! Closes #248 #249

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sjefferson99
Copy link
Member

No description provided.

@sjefferson99 sjefferson99 linked an issue Oct 14, 2024 that may be closed by this pull request
Copy link
Collaborator

@sam57719 sam57719 left a comment

Choose a reason for hiding this comment

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

Code is massive and looks OK, apart from some PEP8 naming convention violations.

I want to test this myself on my own SMIBHID dev board. Probably wont happen until tomorrow or Wednesday.

from json import dumps
import uasyncio

class Web_App:
Copy link
Collaborator

Choose a reason for hiding this comment

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

PEP8 naming violation - should be WebApp

self.app.add_resource(wlan_mac, '/api/wlan/mac', wifi = self.wifi, logger = self.log)
self.app.add_resource(version, '/api/version', hid = self.hid, logger = self.log)

class wlan_mac():
Copy link
Collaborator

Choose a reason for hiding this comment

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

again - should be PEP8

logger.info(f"Return value: {html}")
return html

class version():
Copy link
Collaborator

Choose a reason for hiding this comment

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

PEP8

self.code = code


class request:
Copy link
Collaborator

Choose a reason for hiding this comment

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

PEP8

raise HTTPException(400)


class response:
Copy link
Collaborator

Choose a reason for hiding this comment

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

PEP8

await resp.send(res_str)


class webserver:
Copy link
Collaborator

Choose a reason for hiding this comment

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

PEP8

@sjefferson99
Copy link
Member Author

PEP8 issues adjusted. The webserver module is not mine, but I have adjusted enough of it already to take on and continue adjusting things like class names and have adjusted these as well.

Copy link
Collaborator

@sam57719 sam57719 left a comment

Choose a reason for hiding this comment

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

Happy with the PEP8 changes

@sam57719
Copy link
Collaborator

@sjefferson99 I want to test this tomorrow/Wednesday before I approve

@sam57719
Copy link
Collaborator

There is a merge conflict - please sort it :) @sjefferson99

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.

Add a webserver to smibhid for admin purposes
2 participants