Skip to main content

Control SNOOZ white noise machines.

Project description

PySnooz

Python Language + Bleak API + SNOOZ White Noise Machine

CI Status Test coverage percentage PyPI Version

Control SNOOZ white noise machines with Bluetooth.

Installation

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

pip install pysnooz

Usage

import asyncio
from datetime import timedelta
from bleak.backends.client import BLEDevice
from pysnooz.device import SnoozDevice
from pysnooz.commands import SnoozCommandResultStatus, turn_on, turn_off, set_volume

# found with discovery
ble_device = BLEDevice(...)
token = "deadbeef"

device = SnoozDevice(ble_device, token, asyncio.get_event_loop())

# optionally specify a volume to set before turning on
await device.async_execute_command(turn_on(volume=100))

# you can transition volume by specifying a duration
await device.async_execute_command(turn_off(duration=timedelta(seconds=10)))

# you can also set the volume directly
await device.async_execute_command(set_volume(50))

# view the result of a command execution
result = await device.async_execute_command(turn_on())
assert result.status == SnoozCommandResultStatus.SUCCESS
result.duration # how long the command took to complete

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

This package was created with Cookiecutter and the browniebroke/cookiecutter-pypackage project template.

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

pysnooz-0.7.2.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

pysnooz-0.7.2-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pysnooz-0.7.2.tar.gz.

File metadata

  • Download URL: pysnooz-0.7.2.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.8.2 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for pysnooz-0.7.2.tar.gz
Algorithm Hash digest
SHA256 26e6e401b8e8f91a4d3b486fe88780e9d56bd3e491933515cf8c2da5cdde2304
MD5 a2cf1630dc37bf48dd9cff2cf7e6c8f3
BLAKE2b-256 af8cca084ec26b20a9a4219b022ecfcad6dd88560b62997e03ca72f405af85e9

See more details on using hashes here.

File details

Details for the file pysnooz-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: pysnooz-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.8.2 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for pysnooz-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bbb888c8b4387ccffab20c75d9865ca65219f7afdcb9cbadfdd6b61ef07a2eb7
MD5 ae4df15eda576c77f5a0cea17fcfa982
BLAKE2b-256 121c0f1a088bedad590f5120681e37d42e8c42e6c8bba0f4e01619ced667f504

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