File: basic.py

package info (click to toggle)
aiostreammagic 2.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 340 kB
  • sloc: python: 1,005; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import asyncio

from aiostreammagic import StreamMagicClient, Source, Info

HOST = "192.168.x.x"  # Replace with your StreamMagic device's IP address


async def main() -> None:
    """Basic demo entrypoint."""
    client = StreamMagicClient(HOST)
    await client.connect()

    info: Info = await client.get_info()
    sources: list[Source] = await client.get_sources()

    print(f"Model: {info.model}")
    for source in sources:
        print(f"Name: {source.id} ({source.id})")

    await client.disconnect()


if __name__ == "__main__":
    asyncio.run(main())