From 4ed1e36ca90da817f1c9a12e92b14578e4aec475 Mon Sep 17 00:00:00 2001 From: Igor Listopad <31544843+igorlistopad@users.noreply.github.com> Date: Sun, 8 Mar 2026 23:40:58 +0300 Subject: [PATCH 1/2] Add support set Do Not Disturb mode --- .../yandex_station/core/yandex_station.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/custom_components/yandex_station/core/yandex_station.py b/custom_components/yandex_station/core/yandex_station.py index 2752577..a95b17f 100644 --- a/custom_components/yandex_station/core/yandex_station.py +++ b/custom_components/yandex_station/core/yandex_station.py @@ -388,6 +388,18 @@ async def _set_led(self, **kwargs): await self.quasar.set_device_config(self.device, config, version) + async def _set_dnd_mode(self, value: str): + if value == "True": + value = True + elif value == "False": + value = False + else: + return + + config, version = await self.quasar.get_device_config(self.device) + config["dndMode"]["enabled"] = value + await self.quasar.set_device_config(self.device, config, version) + async def _set_beta(self, value: str): if value == "True": value = True @@ -811,6 +823,9 @@ async def async_play_media( elif media_type == "visualization": await self._set_led(visualization=media_id) return + elif media_type == "dnd_mode": + await self._set_dnd_mode(media_id) + return elif media_type == "beta": await self._set_beta(media_id) return From fa677b1ea7b223461be545c3f7d76334539deda8 Mon Sep 17 00:00:00 2001 From: Igor Listopad <31544843+igorlistopad@users.noreply.github.com> Date: Mon, 9 Mar 2026 07:35:34 +0300 Subject: [PATCH 2/2] Fix: Add support set Do Not Disturb mode --- custom_components/yandex_station/core/yandex_station.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/yandex_station/core/yandex_station.py b/custom_components/yandex_station/core/yandex_station.py index a95b17f..c0215b7 100644 --- a/custom_components/yandex_station/core/yandex_station.py +++ b/custom_components/yandex_station/core/yandex_station.py @@ -397,6 +397,10 @@ async def _set_dnd_mode(self, value: str): return config, version = await self.quasar.get_device_config(self.device) + + if config.get("dndMode") is None: + raise HomeAssistantError("Режим 'не беспокоить' не поддерживается этим устройством") + config["dndMode"]["enabled"] = value await self.quasar.set_device_config(self.device, config, version)