mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Fix DLNA DMR media receiver when using Python 3.9 (#42430)
This commit is contained in:
parent
6776b1ddd7
commit
bbbe64f1aa
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user