Skip to main content

Library built on AsyncIO for communicating with Samsung Wireless Audio speakers (WAM).

Project description

pywam

PyPi Downloads

pywam is an fast and lightweight python asyncio library without external dependencies for communicating with Samsung Wireless Audio (R) speakers (WAM). It was developed to be used for integrating the speakers in Home Assistant.

Features

  • Control Samsung Multiroom speakers.
  • Keep track of the state of Samsung Multiroom speakers.

Installation

pip install pywam

Usage

Set the speaker volume to 50% with python context manager:

from pywam.speaker import Speaker

async with Speaker('192.168.1.100') as speaker:
    speaker.set_volume(50)

Example of controlling media playback:

# Play
await speaker.cmd_play()
# Pause
await speaker.cmd_pause()
# Shuffle mode
await speaker.set_shuffle(True)

Get notifications about speakers state:

from pywam.speaker import Speaker

def state_receiver(event):
    print(event)

speaker = Speaker('192.168.1.150')
speaker.events.register_subscriber(state_receiver, 2)
speaker.connect()
speaker.update()

Contribute

Style guide

PEP8 and Google styled PEP257. But none of them is strictly enforced.

License

The project is licensed under the MIT License.

Disclaimer Notice

I have tested all functions in this library on all of my Samsung Multiroom speakers, and the worst that has happened is that speakers froze when receiving faulty calls, and needed a hard reset. But I CAN’T guarantee that your speaker is compatible with this library, and you can’t hold me responsible if you brick your speaker when using this library.

Versioning and Changelog

This project uses Semantic Versioning. The changelog format is based on Keep a Changelog

Credits

This project would not have been possible without, but not limited to, the following projects:

Support the work

BuyMeCoffee

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

pywam-0.1.0rc2.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

pywam-0.1.0rc2-py3-none-any.whl (49.4 kB view details)

Uploaded Python 3

File details

Details for the file pywam-0.1.0rc2.tar.gz.

File metadata

  • Download URL: pywam-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pywam-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 f327df713c839abc59be644fc7b4a9680379c78e130019d05ccfb38a160b146a
MD5 9b0306aae637ff0a963ffa6069adfc20
BLAKE2b-256 c5d66167c77318876442c0f9ff08e4ff0a918dd6c1a9851aedfd6f6bf258050b

See more details on using hashes here.

File details

Details for the file pywam-0.1.0rc2-py3-none-any.whl.

File metadata

  • Download URL: pywam-0.1.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 49.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pywam-0.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 cbd28fb30b71672f7bcd0a8e6e8cafae4a209095767b9ab37ae0cdf4fcf02f75
MD5 9fc0d9512bab39608f15c3a5aa28ef6d
BLAKE2b-256 0ece902f14c10909936870d48907c2268c3ff8f639de821ea9f0bcf67c2c7186

See more details on using hashes here.

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