-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Move code related to interacting with the PINECIL to separate library for use by other projects #199
Comments
better modularity sounds like a great idea. |
I was giving a look at the code and, at least for a "version zero", I think that keeping the files mostly as they are could work quite well (perhaps just renaming some parts here and there). This should also require minimal changes to main_server.py (in theory just the imports, which would become simpler). from ble import DeviceNotFoundException
from ble import DeviceDisconnectedException
from pinecil_ble import Pinecil
from pinecil_ble import InvalidSettingException
from pinecil_ble import ValueOutOfRangeException To something like: from <NEW_LIBRARY> import Pinecil
from <NEW_LIBRARY> import (
DeviceNotFoundException,
DeviceDisconnectedException,
InvalidSettingException,
ValueOutOfRangeException
) The relevant tests should also be moved: test_pinecil.py, test_data.py and a copy of test_utils.py Does this looks like a good approach to you? |
i think i get the idea, i'll get started, then post a link here to the new repo |
started the library here https://github.com/builder555/pinecil_lib |
Awesome, thank you! |
It's basically done, can be used in any project. I just can't publish right now since PyPi admins are on vacations. |
now you can use |
There is some issue or todo from PineSAM that might be worth moving to and addressing in the new library? |
The first two require firmware changes, the last one isn't applicable here, since you would be the one implementing the entire pairing process (e.g. searching for devices, connecting to it, getting the settings, updating settings). The library only provides the functions, but doesn't have any pairing process on its own. |
Is your feature request related to a problem? Please describe.
The code used for talking to the PINECIL is at the moment embedded in the backend part of PineSAM (in the files ble.py, pinecil_ble.py, crx_uuid_name_map.py and pinecil_setting_limits.py).
If someone wanted to make another python application for interacting with the PINECIL (I, for one, would like to write one using Textual to avoid having to use the browser and do everything in the terminal), they would need to:
All of which seem less than ideal solutions. Even for PineSAM itself because it would make contributing upstream from the derived project back to that part of PineSAM a pain.
Describe the solution you'd like
Move the relevant part of the project to a separate library. This would not only enable other developers to reuse your code for different projects but also likely simplify maintenance and improvement efforts for PineSAM.
Additional context
No additional context.
The text was updated successfully, but these errors were encountered: