Library built on AsyncIO for communicating with Samsung Wireless Audio speakers (WAM).
Project description
pywam
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
- Issue Tracker: https://github.com/Strixx76/pywam/issues
- Source Code: https://github.com/Strixx76/pywam
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:
- Samsung Wireless Audio Multiroom (WAM) Research, Moosy Research
- WAM_API_DOC, Bruno Lopes
- com.samsung.wam, Bjørnar Almli
- Hubitat-Samsung-WiFi-Audio, David Gutheinz
- Samsung Multiroom (WIP), Krystian Galutowski
- SamsungNotify, Moengiant
Support the work
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pywam-0.1.0rc1.tar.gz
.
File metadata
- Download URL: pywam-0.1.0rc1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 172f8cee830d235a51e1baac617782d09cb4a0490dec3d9f3f00b863571f40db |
|
MD5 | c9336fecc08ebb70fb7284cba89bfb0b |
|
BLAKE2b-256 | 15005f11e3722e1d590b14d563553c6c86a7e30e9e71dfeb58df2c060cc06f70 |
File details
Details for the file pywam-0.1.0rc1-py3-none-any.whl
.
File metadata
- Download URL: pywam-0.1.0rc1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b3a6ebfa890538e24295d8d04e268c259354430a933baab39bd16d12d2f445b |
|
MD5 | ce3d14ea23927b597d6000c6ea14927f |
|
BLAKE2b-256 | 543fbad3616e3d63e5bb25fcd24e631bdaed0e34969f34a1a7d053fc8ceff3ab |