Metadata-Version: 2.1
Name: pinecil
Version: 0.1.0
Summary: A python interface for Pinecil V2 controls and settings.
License: MIT-0
Author: builder555
Author-email: 85308587+builder555@users.noreply.github.com
Requires-Python: >=3.10,<3.13
Classifier: License :: OSI Approved
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: bleak (>=0.21.1,<0.22.0)
Description-Content-Type: text/markdown

[![Automated lint and tests](https://github.com/builder555/pinecil_lib/actions/workflows/lint-test.yml/badge.svg?branch=master)](https://github.com/builder555/pinecil_lib/actions/workflows/lint-test.yml)

# Pinecil V2 interface library

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

## Requirements
- Python 3.10 or higher

## Installation -- DOES NOT WORK YET

until PyPi restores functionality, I cannot publish this library

```bash
pip install pinecil
```

## Usage Example

A complete from-scratch example:

```python
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:

```python
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:

```python
from pinecil import find_device_addresses
import asyncio

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

## Testing

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

## License
This project is licensed under the MIT-0 License

## Authors
- **[builder555](https://github.com/builder555)** - *Initial work*

## References
- Originally started as [PineSAM](https://github.com/builder555/PineSAM)

## TODO

- [x] able to scan for ble devices
- [x] able to connect to pinecil
- [x] get pinecil info
- [x] get settings
- [x] set settings
- [x] proper readme
- [x] run build on merge
- [x] run tests on merge
- [x] run lint on merge
- [ ] ci/cd - build and push to pypi

