diff --git a/aiostreammagic/endpoints.py b/aiostreammagic/endpoints.py index f9c2ecf..8915b93 100644 --- a/aiostreammagic/endpoints.py +++ b/aiostreammagic/endpoints.py @@ -8,4 +8,5 @@ POSITION = "/zone/play_state/position" NOW_PLAYING = "/zone/now_playing" PLAY_CONTROL = "/zone/play_control" +STREAM_RADIO = "/stream/radio" POWER = "/system/power" diff --git a/aiostreammagic/stream_magic.py b/aiostreammagic/stream_magic.py index 7abd89d..dfd8e80 100644 --- a/aiostreammagic/stream_magic.py +++ b/aiostreammagic/stream_magic.py @@ -406,3 +406,20 @@ async def set_repeat(self, repeat: RepeatMode): ep.PLAY_CONTROL, params={"match": "none", "zone": "ZONE1", "mode_repeat": repeat}, ) + + async def play_radio_airable(self, name: str, airable_radio_id: int) -> None: + """Play an airable radio station.""" + await self.request( + ep.STREAM_RADIO, + params={ + "zone": "ZONE1", + "airable_radio_id": airable_radio_id, + "name": name, + }, + ) + + async def play_radio_url(self, name: str, url: str) -> None: + """Play a radio station from a provided url.""" + await self.request( + ep.STREAM_RADIO, params={"zone": "ZONE1", "url": url, "name": name} + ) diff --git a/pyproject.toml b/pyproject.toml index f770131..3fb5578 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "aiostreammagic" -version = "2.3.1" +version = "2.4.0" description = "An async python package for interfacing with Cambridge Audio / Stream Magic compatible streamers." authors = ["Noah Husby <32528627+noahhusby@users.noreply.github.com>"] maintainers = ["Noah Husby <32528627+noahhusby@users.noreply.github.com>"]