Skip to main content

Async library for controlling the Apart Zone4 preamp via serial

Project description

Zone4

Zone4 is a Python library for interacting with the Apart Zone4 pre-amplifier over serial.

Installation

Use the package manager pip to install zone4.

pip install zone4

Usage

import asyncio
from zone4 import Zone4Manager

async def set_volume(manager, zone, volume):
	await manager.zone(zone).set_volume(volume)

async def update(manager, loop):
	await manager.update()
	loop.create_task(update(manager, loop))

if __name__ == '__main__':
  loop = asyncio.new_event_loop()
  asyncio.set_event_loop(loop)

  manager = Zone4Manager('/dev/ttyS3')

  loop.run_until_complete(manager.setup())

  loop.create_task(set_volume(manager, 'a', 55))
  loop.create_task(update(manager, loop))

  loop.run_forever()
  loop.close()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU GPLv3

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

zone4-0.0.1.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

zone4-0.0.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file zone4-0.0.1.tar.gz.

File metadata

  • Download URL: zone4-0.0.1.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for zone4-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4e452d8697579a9bb2b07db6449bd92a2e3e9d6e228f4072f594b8e9bd7284a2
MD5 51b3afc27d33e6c66a00ae0c7fb02cc7
BLAKE2b-256 d897e0cbedecaabd510a309a80181ecdd618faf1cffabbea786070198557bc9f

See more details on using hashes here.

File details

Details for the file zone4-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: zone4-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for zone4-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33946028b991cb3ed8b171d550eb44f2ff10c777318fc664af600c9cd1930a80
MD5 33ed0a12df111d5724757a1f62f22467
BLAKE2b-256 ede51ee5f60aaa4ca37096079016295d897294b3b2f85df8b1b5626904918fd0

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