From 335422ce927d492b0487bb7a402869713a516b89 Mon Sep 17 00:00:00 2001 From: Alex X Date: Wed, 13 Mar 2024 22:29:49 +0300 Subject: [PATCH] Fix volume control for Yandex TV --- custom_components/yandex_station/core/yandex_station.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/yandex_station/core/yandex_station.py b/custom_components/yandex_station/core/yandex_station.py index 9e3c8e9..c9a6bc8 100644 --- a/custom_components/yandex_station/core/yandex_station.py +++ b/custom_components/yandex_station/core/yandex_station.py @@ -696,7 +696,10 @@ async def async_set_volume_level(self, volume: float): await self.glagol.send({"command": "setVolume", "volume": round(volume, 1)}) else: - await self.quasar.send(self.device, f"громкость на {round(10 * volume)}") + # на Яндекс ТВ Станция (2023) громкость от 0 до 100 + # на колонках - от 0 до 10 + k = 100 if self.platform == "magritte" else 10 + await self.quasar.send(self.device, f"громкость на {round(k * volume)}") if volume > 0: self._attr_is_volume_muted = False self._attr_volume_level = round(volume, 2)