Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ble_apple_notification_center/badge/?version=latest
:target: https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/actions
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
BLE library for the Apple Notification Center
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.
Installing from PyPI
=====================
.. note:: This library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-ble_apple_notification_center/>`_. To install for current user:
.. code-block:: shell
pip3 install adafruit-circuitpython-ble-apple-notification-center
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install adafruit-circuitpython-ble-apple-notification-center
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-ble-apple-notification-center
Usage Example
=============
.. code::python
"""
This example solicits that apple devices that provide notifications connect to it, initiates
pairing, and prints existing notifications.
"""
import adafruit_ble
from adafruit_ble.advertising.standard import SolicitServicesAdvertisement
import adafruit_ble_apple_notification_center as ancs
radio = adafruit_ble.BLERadio()
a = SolicitServicesAdvertisement()
a.solicited_services.append(ancs.AppleNotificationCenterService)
radio.start_advertising(a)
print("Waiting for connection")
while not radio.connected:
pass
print("Connected")
for connection in radio.connections:
if ancs.AppleNotificationCenterService not in connection:
continue
if not connection.paired:
connection.pair()
print("Paired")
ans = connection[ancs.AppleNotificationCenterService]
# Wait for the notifications to load.
while len(ans.active_notifications) == 0:
pass
for notification_id in ans.active_notifications:
notification = ans.active_notifications[notification_id]
print(notification.app_id, notification.title)
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/>`_.
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": "",
"name": "adafruit-circuitpython-ble-apple-notification-center",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "adafruit,blinka,circuitpython,micropython,ble_apple_notification_center,ble,ancs,apple,notification",
"author": "",
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/bc/85/2acde2e33d51c6604550efc578cf3754e492127350fb762ec04ef382158e/adafruit-circuitpython-ble-apple-notification-center-0.10.8.tar.gz",
"platform": null,
"description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ble_apple_notification_center/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/\n :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n :target: https://adafru.it/discord\n :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/actions\n :alt: Build Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code Style: Black\n\nBLE library for the Apple Notification Center\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.\n\nInstalling from PyPI\n=====================\n.. note:: This library is not available on PyPI yet. Install documentation is included\n as a standard element. Stay tuned for PyPI availability!\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-ble_apple_notification_center/>`_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-ble-apple-notification-center\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-ble-apple-notification-center\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .venv\n source .venv/bin/activate\n pip3 install adafruit-circuitpython-ble-apple-notification-center\n\nUsage Example\n=============\n\n.. code::python\n\n \"\"\"\n This example solicits that apple devices that provide notifications connect to it, initiates\n pairing, and prints existing notifications.\n \"\"\"\n\n import adafruit_ble\n from adafruit_ble.advertising.standard import SolicitServicesAdvertisement\n import adafruit_ble_apple_notification_center as ancs\n\n radio = adafruit_ble.BLERadio()\n a = SolicitServicesAdvertisement()\n a.solicited_services.append(ancs.AppleNotificationCenterService)\n radio.start_advertising(a)\n\n print(\"Waiting for connection\")\n\n while not radio.connected:\n pass\n\n print(\"Connected\")\n\n for connection in radio.connections:\n if ancs.AppleNotificationCenterService not in connection:\n continue\n\n if not connection.paired:\n connection.pair()\n print(\"Paired\")\n\n ans = connection[ancs.AppleNotificationCenterService]\n # Wait for the notifications to load.\n while len(ans.active_notifications) == 0:\n pass\n for notification_id in ans.active_notifications:\n notification = ans.active_notifications[notification_id]\n print(notification.app_id, notification.title)\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ble_apple_notification_center/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "BLE library for the Apple Notification Center",
"version": "0.10.8",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center"
},
"split_keywords": [
"adafruit",
"blinka",
"circuitpython",
"micropython",
"ble_apple_notification_center",
"ble",
"ancs",
"apple",
"notification"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cf18003e4782dfb18cf3837f123d1decdd6c6ffe57425de81dd5f70f785227ba",
"md5": "e029d77bb0f9a7eec01020f8cd2c1208",
"sha256": "30e94cf05b8ff416a6fd5b96793d1827b3ec624249a38b0f111ee09daad91843"
},
"downloads": -1,
"filename": "adafruit_circuitpython_ble_apple_notification_center-0.10.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e029d77bb0f9a7eec01020f8cd2c1208",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7104,
"upload_time": "2023-09-25T15:58:04",
"upload_time_iso_8601": "2023-09-25T15:58:04.628857Z",
"url": "https://files.pythonhosted.org/packages/cf/18/003e4782dfb18cf3837f123d1decdd6c6ffe57425de81dd5f70f785227ba/adafruit_circuitpython_ble_apple_notification_center-0.10.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc852acde2e33d51c6604550efc578cf3754e492127350fb762ec04ef382158e",
"md5": "8b29fa699fb3f0f7e823462cfcb5cc3f",
"sha256": "4ca538b94bf2c3a57c3385be64cf73d36e3cb453032e0e4d55e1ae88c66657b2"
},
"downloads": -1,
"filename": "adafruit-circuitpython-ble-apple-notification-center-0.10.8.tar.gz",
"has_sig": false,
"md5_digest": "8b29fa699fb3f0f7e823462cfcb5cc3f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29188,
"upload_time": "2023-09-25T15:58:06",
"upload_time_iso_8601": "2023-09-25T15:58:06.145350Z",
"url": "https://files.pythonhosted.org/packages/bc/85/2acde2e33d51c6604550efc578cf3754e492127350fb762ec04ef382158e/adafruit-circuitpython-ble-apple-notification-center-0.10.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-25 15:58:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_BLE_Apple_Notification_Center",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "Adafruit-Blinka",
"specs": []
},
{
"name": "adafruit-circuitpython-ble",
"specs": []
}
],
"lcname": "adafruit-circuitpython-ble-apple-notification-center"
}