Skip to main content

Python hardware API for Nissan Leaf OBD BLE dongles (BLE + ELM327 over CAN), extracted from the Home Assistant integration.

Project description

py-nissan-leaf-obd-ble

Python hardware API for Nissan Leaf OBD-II over BLE dongles.

This library encapsulates the low-level BLE, ELM327 and CAN protocol handling used by the Home Assistant nissan_leaf_obd_ble integration, and exposes a simple async API for querying vehicle data from a BLEDevice.

It has no Home Assistant dependency and can be used in other Python applications that talk to the same BLE OBD dongle.

Installation

Once published on PyPI:

pip install py-nissan-leaf-obd-ble

Quickstart

import asyncio
from bleak import BleakScanner

from py_nissan_leaf_obd_ble import NissanLeafObdBleApiClient


async def main() -> None:
    # Discover your OBDBLE device with bleak, or obtain a BLEDevice from elsewhere
    device = await BleakScanner.find_device_by_address("AA:BB:CC:DD:EE:FF", timeout=10.0)
    if device is None:
        raise RuntimeError("Could not find OBDBLE device")

    client = NissanLeafObdBleApiClient(device)
    data = await client.async_get_data()
    print(data)


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

License

This package includes code derived from python-OBD (a derivative of pyOBD), licensed under the GNU General Public License, version 2 or later.

See LICENSE for full terms.

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

py_nissan_leaf_obd_ble-0.1.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_nissan_leaf_obd_ble-0.1.0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file py_nissan_leaf_obd_ble-0.1.0.tar.gz.

File metadata

  • Download URL: py_nissan_leaf_obd_ble-0.1.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for py_nissan_leaf_obd_ble-0.1.0.tar.gz
Algorithm Hash digest
SHA256 52811f1ec27bad412a840d20a2c21dcabca4b51eecb5b86d042ea35d54d8ea4f
MD5 708581d5d56f2fbfa122182321710ff2
BLAKE2b-256 c9f57841904a273bb01789705a13b6b83d71d9f18854cbc4083ae7cfdaa9a786

See more details on using hashes here.

File details

Details for the file py_nissan_leaf_obd_ble-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_nissan_leaf_obd_ble-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74c0dbd8d2acd17a83b3430e8e2638aecbd3206ee6b3261c5f2546e3c5f013fe
MD5 11ae56216e0afe9e3488c8246e8d464d
BLAKE2b-256 f57fe0fddf609fcb273506584852e3cc57ebd445ccf84be4c772f9e8954be6e6

See more details on using hashes here.

Supported by

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