-
Notifications
You must be signed in to change notification settings - Fork 122
YoLink API Integration to PLR #657
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
base: main
Are you sure you want to change the base?
Conversation
…into yo_link_api
|
this seems to copy a lot of files from https://github.com/YoSmart-Inc/yolink-api into PLR. why not have this code as a dependency? |
I think this would be a good idea - YoLink has a dependency that can be installed through pip but I haven't really tested that out to see if it works properly. I'm also not familiar with adding custom dependencies, but I can take a look into this |
|
see setup.py for examples. installing from pypi would be best if they offer it having a dependency means we can use their updates moving forward and are not responsible for maintenance |
Tried out the pypi installation of yolink-api and it seems to be working fine - I also added it as an extra dependency following the examples in setup.py |
|
@rickwierenga if I were to add documentation for setting up and using the yolink api, where should I include it? Looking at the current doc setup, it would make sense to add something in |
|
definitely put it under user guide, make a new section for sensors (next to plate readers, under analytical). we group by function first rather than manufacturer. if in the future we have other devices that are not sensors we can make sections for those API is for documenting all classes functions etc. it is auto generated docs are very important to actually getting people to adopt and use your code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
sounds good! |
|
thank you for adding yolink as a dependency. it is much easier to review this PR and code will be maintainable in the future. since this API is introducing a The current YoLink class should probably be an |
|
made a forum posts to discuss outlets: https://discuss.pylabrobot.org/t/integrating-outlets-in-plr/323 |
49a6770 to
159fd78
Compare
bffeb24 to
a1d61b7
Compare
1675cd6 to
2b2f7f9
Compare
Added YoLink API wrapper to PLR to integrate the YoLink family of devices. More information can be found in the forum post: https://discuss.pylabrobot.org/t/yolink-api-integration-advice/297
In the main pylabrobot directory, I added the yolink directory and tried my best to follow the conventions already set.
There are two ways to use the YoLink API wrapper:
More details about getting UAID, Secret Key, and Access Token can be found here: http://doc.yosmart.com/docs/overall/qsg_uac
Currently, the two types of devices I implemented are the
Sensor()and theOutlet(). The sensor can return readings such as temperature, humidity, etc, while the outlet (yolink smart power strip) includes both read and write commands. The forum post has more details about this.YoLink also comes with a few additional dependencies that aren't already in pylabrobot:
How should these be handled?
I am setting this as a draft PR since I have only done preliminary testing with the API wrapper. Theoretically, the rest of the PLR code should function as normal since the YoLink code doesn't interact with the rest of the codebase, but testing needs to be done to be sure. Additionally, I tried to follow PLR conventions + best practices but feedback on the code structure and implementation from someone more experienced would be great.