Sonos API¶
Module for interacting with the Sonos node.js API.
-
class
dashboard.sonos.Sonos(session, api_host=None, api_base=None)[source]¶ A module for querying the node.js Sonos API:
sonos = Sonos(uvhttp.session.Session(5, asyncio.get_event_loop())) zones = await sonos.api('zones') print(zones)
It will automatically find the API if it is reachable on localhost, the default gateway, or
docker.for.mac.local. If it is not one of these, it should be indicated in theapi_hostargument.