mirror of
https://github.com/home-assistant/core.git
synced 2025-05-02 21:19:16 +00:00
Avoid linear search in ps4 to find devices (#114814)
This commit is contained in:
parent
0710f4c661
commit
cc96bc44a0
@ -350,16 +350,17 @@ class PS4Device(MediaPlayerEntity):
|
||||
self._attr_unique_id = entry.unique_id
|
||||
self.entity_id = entry.entity_id
|
||||
break
|
||||
for device in d_registry.devices.values():
|
||||
if self._entry_id in device.config_entries:
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers=device.identifiers,
|
||||
manufacturer=device.manufacturer,
|
||||
model=device.model,
|
||||
name=device.name,
|
||||
sw_version=device.sw_version,
|
||||
)
|
||||
break
|
||||
for device in d_registry.devices.get_devices_for_config_entry_id(
|
||||
self._entry_id
|
||||
):
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers=device.identifiers,
|
||||
manufacturer=device.manufacturer,
|
||||
model=device.model,
|
||||
name=device.name,
|
||||
sw_version=device.sw_version,
|
||||
)
|
||||
break
|
||||
|
||||
else:
|
||||
_sw_version = status["system-version"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user