kjy00302 / niimprint

(WIP) Niimbot printer client. Tested on D11.
MIT License
90 stars 46 forks source link

Add API to get template info #1

Closed redphx closed 1 year ago

redphx commented 1 year ago

Thank you for the repo. It also works on my D110. Sadly Python's Bluetooth API doesn't support MacOS so I have to test it on a Raspi 2 Zero W. Tried to implement pybluez but it was outdated.

This MR added some features:

Example code:

import niimbot_web_api

resp = niimbot_web_api.get_cloud_template_by_one_code('12162012')
print(resp)

It will return all the info about the paper roll: name, size, background image URL... It's really useful if you want to print/design the correct size.

More will be added later.

redphx commented 1 year ago

What do you think about renaming niimbotpacket.py to niimbot_packet.py? I think it look better.

kjy00302 commented 1 year ago

What being called barcode in the get_rfid() method is actually called one_code. I think we should rename it.

In API's response, the code referenced as "barcode". So, I think barcode is more appropriate.

redphx commented 1 year ago

File permission changed to 755. Was it intended?

Sorry it wasn't intentional. The Samba server on my Pi did it. I had to use it to code remotely on Pi from Mac.