Skip to content

Commit

Permalink
Fix volume control for Yandex TV
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Mar 13, 2024
1 parent 6d76a29 commit 335422c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/yandex_station/core/yandex_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 335422c

Please sign in to comment.