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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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