"""What every receiver protocol has to provide.""" from __future__ import annotations from ..devices import Device class BackendError(Exception): pass class Backend: kind = "" #: Containers this protocol can be handed, best first. containers: tuple[str, ...] = ("webm",) #: Does it pull a plain HTTP stream (True) or an HLS playlist (False)? progressive = True def __init__(self, daemon) -> None: self.daemon = daemon async def play(self, device: Device, url: str, *, container: str, title: str) -> None: raise NotImplementedError async def stop(self, device: Device) -> None: raise NotImplementedError async def set_volume(self, device: Device, volume: float) -> None: raise BackendError("this receiver has no volume control") async def set_muted(self, device: Device, muted: bool) -> None: raise BackendError("this receiver has no mute control") async def transport(self, device: Device, action: str) -> None: raise BackendError("this receiver has no transport control") async def poll(self, device: Device) -> dict: """Live status of the session: {state, app, volume, muted, error}.""" return {} async def close(self) -> None: return None