Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавление Мини3 #573

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions custom_components/yandex_station/core/yandex_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@
"yandexstation_2": ["yandex:station-max", "Яндекс", "Станция Макс (2020)"],
"yandexmini": ["yandex:station-mini", "Яндекс", "Станция Мини (2019)"],
"yandexmini_2": ["yandex:station-mini-2", "Яндекс", "Станция Мини 2 (2021)"],
"bergamot": ["yandex:station-mini-3", "Яндекс", "Станция Мини 3 (2024)"],
"yandexmicro": ["yandex:station-lite", "Яндекс", "Станция Лайт (2021)"],
"plum": ["yandex:station-lite-2", "Яндекс", "Станция Лайт 2 (2024)"],
"yandexmidi": ["yandex:station-2", "Яндекс", "Станция 2 (2022)"], # zigbee
"cucumber": ["yandex:station-midi", "Яндекс", "Станция Миди (2023)"], # zigbee
"chiron": ["yandex:station-duo-max", "Яндекс", "Станция Дуо Макс (2023)"], # zigbee
"plum": ["yandex:station-lite-2", "Яндекс", "Станция Лайт 2 (2024)"],
# платформа Яндекс.ТВ (без облачного управления!)
"yandexmodule": ["yandex:module", "Яндекс", "Модуль (2019)"],
"yandexmodule_2": ["yandex:module-2", "Яндекс", "Модуль 2 (2021)"],
Expand Down Expand Up @@ -369,7 +370,7 @@ async def response(self, card: dict, request_id: str):
)

async def _set_brightness(self, value: str):
if self.device_platform not in ("yandexstation_2", "yandexmini_2", "cucumber"):
if self.device_platform not in ("yandexstation_2", "yandexmini_2", "cucumber", "plum", "bergamot"):
_LOGGER.warning("Поддерживаются только станции с экраном")
return

Expand Down Expand Up @@ -671,7 +672,7 @@ async def async_set_volume_level(self, volume: float):
else:
# на Яндекс ТВ Станция (2023) громкость от 0 до 100
# на колонках - от 0 до 10
k = 100 if self.platform == "magritte" else 10
k = 100 if self.platform in ["magritte", "monet"] else 10
await self.quasar.send(self.device, f"громкость на {round(k * volume)}")
if volume > 0:
self._attr_is_volume_muted = False
Expand Down Expand Up @@ -798,7 +799,7 @@ async def async_play_media(
}

elif media_type == "text":
# даже в локальном режиме делам TTS через облако, чтоб колонка
# даже в локальном режиме делаем TTS через облако, чтобы колонка
# не продолжала слушать
force_local: bool = extra and extra.get("force_local")
if self.quasar.session.x_token and not force_local:
Expand Down
Loading