Prevent blocking event loop in ps4 (#126151)
* Prevent blocking event loop in ps4 * Process code review commentpull/125763/head
parent
8ca3310401
commit
3981c87860
|
@ -96,11 +96,10 @@ class PS4Device(MediaPlayerEntity):
|
|||
self._retry = 0
|
||||
self._disconnected = False
|
||||
|
||||
@callback
|
||||
def status_callback(self) -> None:
|
||||
"""Handle status callback. Parse status."""
|
||||
self._parse_status()
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@callback
|
||||
def subscribe_to_protocol(self) -> None:
|
||||
|
@ -157,7 +156,7 @@ class PS4Device(MediaPlayerEntity):
|
|||
self._ps4.ddp_protocol = self.hass.data[PS4_DATA].protocol
|
||||
self.subscribe_to_protocol()
|
||||
|
||||
self._parse_status()
|
||||
await self.hass.async_add_executor_job(self._parse_status)
|
||||
|
||||
def _parse_status(self) -> None:
|
||||
"""Parse status."""
|
||||
|
|
Loading…
Reference in New Issue