Metadata-Version: 2.5
Name: aiomusiccast-co
Version: 0.16.0
Summary: Asyncio library for Yamaha MusicCast devices; maintained fork of aiomusiccast for the Home Assistant integration.
Project-URL: Homepage, https://github.com/crash0verride11/aiomusiccast
Project-URL: Repository, https://github.com/crash0verride11/aiomusiccast
Project-URL: Bug Tracker, https://github.com/crash0verride11/aiomusiccast/issues
Project-URL: Changelog, https://github.com/crash0verride11/aiomusiccast/blob/aiomusiccast-co/CHANGELOG.md
Author-email: Tom Schneider <mail@vigonotion.com>
Maintainer: crash0verride11
License: **The MIT License (MIT)**
        
        Copyright &copy; 2021, Tom Schneider
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
License-File: LICENSE.md
Keywords: asyncio,home-assistant,musiccast,yamaha
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Requires-Dist: aiohttp>=3.9
Description-Content-Type: text/markdown

<div align="center">

<picture>
  <source srcset="https://raw.githubusercontent.com/crash0verride11/aiomusiccast/aiomusiccast-co/banner-dark.png" media="(prefers-color-scheme: dark)">
  <img src="https://raw.githubusercontent.com/crash0verride11/aiomusiccast/aiomusiccast-co/banner.png" alt="aiomusiccast">
</picture>

## Asyncio library for Yamaha MusicCast devices

[![PyPI Version](https://img.shields.io/pypi/v/aiomusiccast-co.svg)](https://pypi.org/project/aiomusiccast-co)
[![CI](https://github.com/crash0verride11/aiomusiccast/actions/workflows/ci.yml/badge.svg?branch=aiomusiccast-co)](https://github.com/crash0verride11/aiomusiccast/actions/workflows/ci.yml)
[![Python Versions](https://img.shields.io/pypi/pyversions/aiomusiccast-co.svg)](https://pypi.org/project/aiomusiccast-co)
[![License](https://img.shields.io/pypi/l/aiomusiccast-co.svg)](https://github.com/crash0verride11/aiomusiccast/blob/aiomusiccast-co/LICENSE.md)

</div>

<br/>

`aiomusiccast-co` is a maintained fork of [aiomusiccast](https://github.com/vigonotion/aiomusiccast), the library
behind Home Assistant's Yamaha MusicCast integration. Upstream is no longer actively maintained, so this fork continues
from its last release (0.15.0) under a new name.

## What's new compared to aiomusiccast 0.15.0

- **Actual volume:** read and set the zone volume in dB, matching the receiver's display.
- **Zone scenes:** list a zone's scenes and recall them.
- **Surround AI:** on/off control for receivers that support it.
- **Speaker pattern** and **device category** support.
- Fixes for devices that omit the zone, input or sound program lists.
- A longer HTTP timeout (8s), and the package now ships `py.typed`.

See the [changelog](https://github.com/crash0verride11/aiomusiccast/blob/aiomusiccast-co/CHANGELOG.md) for details.

# Setup

## Requirements

* Python 3.11+

## Installation

```text
$ pip install aiomusiccast-co
```

or add it to your [uv](https://docs.astral.sh/uv/) project:

```text
$ uv add aiomusiccast-co
```

The distribution is `aiomusiccast-co`; the import name is `aiomusiccast_co`. It installs alongside upstream
`aiomusiccast` without conflict.

# Usage

```python
import asyncio

from aiohttp import ClientSession

from aiomusiccast_co import MusicCastDevice


async def main() -> None:
    async with ClientSession() as session:
        device = MusicCastDevice("192.168.1.50", session)
        await device.fetch()

        print(device.data.model_name, device.data.network_name)
        for zone_id, zone in device.data.zones.items():
            print(zone_id, zone.power, zone.current_volume)

        await device.set_volume_level("main", 0.3)


asyncio.run(main())
```

To get push updates instead of polling, register a callback with `device.register_callback(...)` and call
`await device.device.enable_polling()`, which starts the UDP event listener.

## Migrating from aiomusiccast

Install `aiomusiccast-co` in place of `aiomusiccast` and change the imports:

```python
# before
from aiomusiccast import MusicCastDevice
# after
from aiomusiccast_co import MusicCastDevice
```

The API is otherwise the same as upstream 0.15.0, with the additions above.

# Contributing

See [CONTRIBUTING.md](https://github.com/crash0verride11/aiomusiccast/blob/aiomusiccast-co/CONTRIBUTING.md).

# Credits

Originally written by [Tom Schneider (@vigonotion)](https://github.com/vigonotion) and contributors; `pyamaha.py` is
based on [rsc-dev/pyamaha](https://github.com/rsc-dev/pyamaha). Released under the MIT License.
