Skip to content

Commit

Permalink
Add support changing locale on speaker
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 17, 2024
1 parent 99a2158 commit f1f4dbc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions custom_components/yandex_station/core/yandex_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,13 @@ async def _set_beta(self, value: str):
config["beta"] = value
await self.quasar.set_device_config(self.device, config, version)

async def _set_locale(self, value: str):
assert value in ("ru-RU", "en-US", "ar-SA", "kk-KZ", "tr-TR")

config, version = await self.quasar.get_device_config(self.device)
config["locale"] = value
await self.quasar.set_device_config(self.device, config, version)

async def _set_settings(self, value: str):
data = yaml.safe_load(value)
for k, v in data.items():
Expand Down Expand Up @@ -777,6 +784,9 @@ async def async_play_media(
elif media_type == "beta":
await self._set_beta(media_id)
return
elif media_type == "locale":
await self._set_locale(media_id)
return
elif media_type == "settings":
await self._set_settings(media_id)
return
Expand Down

0 comments on commit f1f4dbc

Please sign in to comment.