home-assistant-bluetooth


Namehome-assistant-bluetooth JSON
Version 1.10.4 PyPI version JSON
download
home_pagehttps://github.com/home-assistant-libs/home-assistant-bluetooth
SummaryHome Assistant Bluetooth Models and Helpers
upload_time2023-10-18 21:31:05
maintainer
docs_urlNone
authorJ. Nick Koston
requires_python>=3.9,<4.0
licenseApache Software License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Home Assistant Bluetooth

<p align="center">
  <a href="https://github.com/home-assistant-libs/home-assistant-bluetooth/actions?query=workflow%3ACI">
    <img src="https://img.shields.io/github/workflow/status/home-assistant-libs/home-assistant-bluetooth/CI/main?label=CI&logo=github&style=flat-square" alt="CI Status" >
  </a>
  <a href="https://codecov.io/gh/home-assistant-libs/home-assistant-bluetooth">
    <img src="https://img.shields.io/codecov/c/github/home-assistant-libs/home-assistant-bluetooth.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
  </a>
</p>
<p align="center">
  <a href="https://python-poetry.org/">
    <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
  </a>
  <a href="https://github.com/ambv/black">
    <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
  </a>
  <a href="https://github.com/pre-commit/pre-commit">
    <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
  </a>
</p>
<p align="center">
  <a href="https://pypi.org/project/home-assistant-bluetooth/">
    <img src="https://img.shields.io/pypi/v/home-assistant-bluetooth.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
  </a>
  <img src="https://img.shields.io/pypi/pyversions/home-assistant-bluetooth.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
  <img src="https://img.shields.io/pypi/l/home-assistant-bluetooth.svg?style=flat-square" alt="License">
</p>

Home Assistant Bluetooth Models and Helpers

## Usage

This library is for accessing Home Assistant Bluetooth models. Libraries use these models to receive and parse Bluetooth advertisement data.

```python
@dataclasses.dataclass
class BluetoothServiceInfo(BaseServiceInfo):
    """Prepared info from bluetooth entries."""

    name: str
    address: str
    rssi: int
    manufacturer_data: dict[int, bytes]
    service_data: dict[str, bytes]
    service_uuids: list[str]
    source: str
```

The data used to populate BluetoothServiceInfo comes from [bleak](https://github.com/hbldh/bleak)'s `BLEDevice` and `AdvertisementData`, except for the `source` field, which comes from Home Assistant and represents the source of the data.

In the future, Home Assistant may support remote Bluetooth transceivers, which may use the source field to determine which device is closest.

## Installation

Install this via pip (or your favourite package manager):

`pip install home-assistant-bluetooth`

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- markdownlint-disable -->
<!-- markdownlint-enable -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-end -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Credits

This package was created with
[Cookiecutter](https://github.com/audreyr/cookiecutter) and the
[browniebroke/cookiecutter-pypackage](https://github.com/browniebroke/cookiecutter-pypackage)
project template.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/home-assistant-libs/home-assistant-bluetooth",
    "name": "home-assistant-bluetooth",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "J. Nick Koston",
    "author_email": "nick@home-assistant.io",
    "download_url": "https://files.pythonhosted.org/packages/82/a7/3761d21f1a61f2bb4d848f42f7115cea87da45a44fbd2053ecde0c63dc1c/home_assistant_bluetooth-1.10.4.tar.gz",
    "platform": null,
    "description": "# Home Assistant Bluetooth\n\n<p align=\"center\">\n  <a href=\"https://github.com/home-assistant-libs/home-assistant-bluetooth/actions?query=workflow%3ACI\">\n    <img src=\"https://img.shields.io/github/workflow/status/home-assistant-libs/home-assistant-bluetooth/CI/main?label=CI&logo=github&style=flat-square\" alt=\"CI Status\" >\n  </a>\n  <a href=\"https://codecov.io/gh/home-assistant-libs/home-assistant-bluetooth\">\n    <img src=\"https://img.shields.io/codecov/c/github/home-assistant-libs/home-assistant-bluetooth.svg?logo=codecov&logoColor=fff&style=flat-square\" alt=\"Test coverage percentage\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://python-poetry.org/\">\n    <img src=\"https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=\" alt=\"Poetry\">\n  </a>\n  <a href=\"https://github.com/ambv/black\">\n    <img src=\"https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square\" alt=\"black\">\n  </a>\n  <a href=\"https://github.com/pre-commit/pre-commit\">\n    <img src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square\" alt=\"pre-commit\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/home-assistant-bluetooth/\">\n    <img src=\"https://img.shields.io/pypi/v/home-assistant-bluetooth.svg?logo=python&logoColor=fff&style=flat-square\" alt=\"PyPI Version\">\n  </a>\n  <img src=\"https://img.shields.io/pypi/pyversions/home-assistant-bluetooth.svg?style=flat-square&logo=python&amp;logoColor=fff\" alt=\"Supported Python versions\">\n  <img src=\"https://img.shields.io/pypi/l/home-assistant-bluetooth.svg?style=flat-square\" alt=\"License\">\n</p>\n\nHome Assistant Bluetooth Models and Helpers\n\n## Usage\n\nThis library is for accessing Home Assistant Bluetooth models. Libraries use these models to receive and parse Bluetooth advertisement data.\n\n```python\n@dataclasses.dataclass\nclass BluetoothServiceInfo(BaseServiceInfo):\n    \"\"\"Prepared info from bluetooth entries.\"\"\"\n\n    name: str\n    address: str\n    rssi: int\n    manufacturer_data: dict[int, bytes]\n    service_data: dict[str, bytes]\n    service_uuids: list[str]\n    source: str\n```\n\nThe data used to populate BluetoothServiceInfo comes from [bleak](https://github.com/hbldh/bleak)'s `BLEDevice` and `AdvertisementData`, except for the `source` field, which comes from Home Assistant and represents the source of the data.\n\nIn the future, Home Assistant may support remote Bluetooth transceivers, which may use the source field to determine which device is closest.\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install home-assistant-bluetooth`\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- markdownlint-disable -->\n<!-- markdownlint-enable -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- prettier-ignore-end -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\nThis package was created with\n[Cookiecutter](https://github.com/audreyr/cookiecutter) and the\n[browniebroke/cookiecutter-pypackage](https://github.com/browniebroke/cookiecutter-pypackage)\nproject template.\n\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Home Assistant Bluetooth Models and Helpers",
    "version": "1.10.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/home-assistant-libs/home-assistant-bluetooth/issues",
        "Changelog": "https://github.com/home-assistant-libs/home-assistant-bluetooth/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/home-assistant-libs/home-assistant-bluetooth",
        "Repository": "https://github.com/home-assistant-libs/home-assistant-bluetooth"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f06385ea21e355f54134200e346e7d8724bfade01333dda56573ab40ff3bfb78",
                "md5": "b44770ae1f0859776f111aa378664273",
                "sha256": "7c3434bdec5dcfe733d3e7c56d4a24418fcd03718dc2e7707c9133d1e48145a8"
            },
            "downloads": -1,
            "filename": "home_assistant_bluetooth-1.10.4-cp310-cp310-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b44770ae1f0859776f111aa378664273",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.9,<4.0",
            "size": 276319,
            "upload_time": "2023-10-18T21:31:03",
            "upload_time_iso_8601": "2023-10-18T21:31:03.747283Z",
            "url": "https://files.pythonhosted.org/packages/f0/63/85ea21e355f54134200e346e7d8724bfade01333dda56573ab40ff3bfb78/home_assistant_bluetooth-1.10.4-cp310-cp310-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82a73761d21f1a61f2bb4d848f42f7115cea87da45a44fbd2053ecde0c63dc1c",
                "md5": "7708a94138d3256c5568cab1adbb3cb9",
                "sha256": "21216b6be9d028bc232b9188ac4dce773798c6b4e47482cc3524bfc5f82515e3"
            },
            "downloads": -1,
            "filename": "home_assistant_bluetooth-1.10.4.tar.gz",
            "has_sig": false,
            "md5_digest": "7708a94138d3256c5568cab1adbb3cb9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 10412,
            "upload_time": "2023-10-18T21:31:05",
            "upload_time_iso_8601": "2023-10-18T21:31:05.558664Z",
            "url": "https://files.pythonhosted.org/packages/82/a7/3761d21f1a61f2bb4d848f42f7115cea87da45a44fbd2053ecde0c63dc1c/home_assistant_bluetooth-1.10.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-18 21:31:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "home-assistant-libs",
    "github_project": "home-assistant-bluetooth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "home-assistant-bluetooth"
}
        
Elapsed time: 0.12988s