Fix DLNA DMR media receiver when using Python 3.9 (#42430)

This commit is contained in:
Tsvi Mostovicz 2020-10-27 15:56:45 +02:00 committed by GitHub
parent 6776b1ddd7
commit bbbe64f1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,7 @@ async def async_setup_platform(
requester = AiohttpSessionRequester(session, True)
# ensure event handler has been started
with await hass.data[DLNA_DMR_DATA]["lock"]:
async with hass.data[DLNA_DMR_DATA]["lock"]:
server_host = config.get(CONF_LISTEN_IP)
if server_host is None:
server_host = get_local_ip()
@ -220,7 +220,7 @@ class DlnaDmrDevice(MediaPlayerEntity):
async def _async_on_hass_stop(self, event):
"""Event handler on Home Assistant stop."""
with await self.hass.data[DLNA_DMR_DATA]["lock"]:
async with self.hass.data[DLNA_DMR_DATA]["lock"]:
await self._device.async_unsubscribe_services()
async def async_update(self):