Skip to content

Commit 03dcd23

Browse files
committed
Fix race condition in async_select_source()
Fixes #23
1 parent 4ae2d1c commit 03dcd23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/extron/media_player.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,5 @@ def create_source_bidict(self) -> bidict:
203203
return make_source_bidict(num_sources, self._input_names)
204204

205205
async def async_select_source(self, source: str):
206-
await self._hdmi_switcher.select_input(self._source_bidict.inverse.get(source))
206+
async with self._hdmi_switcher._device.connection():
207+
await self._hdmi_switcher.select_input(self._source_bidict.inverse.get(source))

0 commit comments

Comments
 (0)