From 63a883f69e81721b6b1e6f84cc959653b838ad3e Mon Sep 17 00:00:00 2001 From: noahhusby <32528627+noahhusby@users.noreply.github.com> Date: Wed, 16 Oct 2024 22:22:00 -0400 Subject: [PATCH] Add preset recall --- aiostreammagic/endpoints.py | 1 + aiostreammagic/stream_magic.py | 4 ++++ pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aiostreammagic/endpoints.py b/aiostreammagic/endpoints.py index b03af9f..e298c27 100644 --- a/aiostreammagic/endpoints.py +++ b/aiostreammagic/endpoints.py @@ -13,3 +13,4 @@ ZONE_AUDIO_OUTPUT = "/zone/audio/output" DISPLAY = "/system/display" PRESET_LIST = "/presets/list" +RECALL_PRESET = "/zone/recall_preset" diff --git a/aiostreammagic/stream_magic.py b/aiostreammagic/stream_magic.py index cb6c35c..2c209a3 100644 --- a/aiostreammagic/stream_magic.py +++ b/aiostreammagic/stream_magic.py @@ -557,3 +557,7 @@ async def set_early_update(self, early_update: bool) -> None: await self.request( ep.UPDATE, params={"early_update": early_update, "action": "CHECK"} ) + + async def recall_preset(self, preset: int) -> None: + """Recall a preset for the device.""" + await self.request(ep.RECALL_PRESET, params={"preset": preset, "zone": "ZONE1"}) diff --git a/pyproject.toml b/pyproject.toml index 17e6f47..cbd220c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "aiostreammagic" -version = "2.8.0" +version = "2.8.1" 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>"]