Skip to main content

Integration of Raumfeld into Home Assistant

Project description

Language grade Python

hassfeld is a module primarily aimed to integrated Teufel Smart Speaker (aka Raumfeld Multiroom) into https://www.home-assistant.io/. However, the design is not tailored to Home Assistant and can be used as a module to any Pyhton program to control the Teufel Smart Speaker. The module also provides corresponding asyncio methods.

Look how it is to use with asyncrhonous I/O:

import asyncio
import aiohttp
import hassfeld


async def main():
    host = "teufel-host.example.com"
    port = 47365
    session = aiohttp.ClientSession()
    raumfeld = hassfeld.RaumfeldHost(host, port, session=session)

    asyncio.create_task(raumfeld.async_update_all(session))
    await raumfeld.async_wait_initial_update()

    zone = ["Master Bedroom"]

    media_info = await raumfeld.async_get_media_info(zone)
    print(f"Media info: {media_info}")

    await session.close()


asyncio.run(main())

The use with blocking I/O was supported too but is currently broken:

import hassfeld
raumfeld_host = "teufel-host.example.com"
zone = [ "Living room", "Kitchen" ]
raumfeld = hassfeld.RaumfeldHost(raumfeld_host)
raumfeld.start_update_thread()
raumfeld.search_and_zone_play(zone, 'raumfeld:any contains "Like a Rolling Stone"')

Features

  • Management and snapshot of zones.

  • Search and play songs.

Install hassfeld by running:

python3 -m pip install hassfeld

Contribute

License

The project is licensed under the GNU General Public License v3 (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

hassfeld-0.3.11a1.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

hassfeld-0.3.11a1-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file hassfeld-0.3.11a1.tar.gz.

File metadata

  • Download URL: hassfeld-0.3.11a1.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4

File hashes

Hashes for hassfeld-0.3.11a1.tar.gz
Algorithm Hash digest
SHA256 3fd0b3e4d1351c8e8d92302660c8937119aa1ae083cbd57295f84e86dabf01c6
MD5 0692b03468fe722f5fbc9068d9e4a026
BLAKE2b-256 f940e03dbbe170d9424d918b8043685de8d5499c7c1431203da411ab3e2ba26f

See more details on using hashes here.

File details

Details for the file hassfeld-0.3.11a1-py3-none-any.whl.

File metadata

  • Download URL: hassfeld-0.3.11a1-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4

File hashes

Hashes for hassfeld-0.3.11a1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce13ec9a0a99a471ad8a828eda25afd0b78ad9206a9e87a9b6cf3330d907e77b
MD5 d178c2d8cea05ae6dc4aa81249d55dbb
BLAKE2b-256 39648b208a5680fcf271693eb213e4e94992445f19c99e964f29e89657c3a60f

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