Skip to main content

A python interface for Pinecil V2 controls and settings.

Project description

Automated lint and tests

Pinecil V2 interface library

Overview

Pinecil is a lightweight Python library designed to inetrafce with Pinecil V2 soldering iron.

Requirements

  • Python 3.9 or higher
  • bluez

Installation

pip install pinecil

Usage Example

A complete from-scratch example:

from pinecil import find_pinecils # if running in a cloned repo, use `from src.pinecil`
import asyncio

async def main():
    await devices = find_pinecils()
    iron = devices[0]
    await iron.connect()
    settings = await iron.get_all_settings()
    await iron.set_one_setting('SetTemperature', 250)
    await iron.save_to_flash() # this is required to preserve settings after powering off
    info = await iron.get_info()
    live = await iron.get_live_data()
    print(settings)
    print('----------')
    print(info)
    print('----------')
    print(live)

if __name__ == '__main__':
    asyncio.run(main())

If you already know the address of your pinecil, you can use it directly:

from pinecil import BLE, Pinecil
import asyncio

if __name__ == '__main__':
    p = Pinecil(BLE('<your-address>'))
    asyncio.run(p.get_all_settings())

To find addresses of all pinecils nearby:

from pinecil import find_device_addresses
import asyncio

if __name__ == '__main__':
    asyncio.run(find_device_addresses('pinecil'))

Testing

poetry shell
pytest -v
# for development convenience:
ptw --runner 'pytest -v'

License

This project is licensed under the MIT-0 License

Authors

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinecil-0.2.9.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

pinecil-0.2.9-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page