Avoid linear search in ps4 to find devices (#114814)
This commit is contained in:
parent
0710f4c661
commit
cc96bc44a0
1 changed files with 11 additions and 10 deletions
|
@ -350,16 +350,17 @@ class PS4Device(MediaPlayerEntity):
|
||||||
self._attr_unique_id = entry.unique_id
|
self._attr_unique_id = entry.unique_id
|
||||||
self.entity_id = entry.entity_id
|
self.entity_id = entry.entity_id
|
||||||
break
|
break
|
||||||
for device in d_registry.devices.values():
|
for device in d_registry.devices.get_devices_for_config_entry_id(
|
||||||
if self._entry_id in device.config_entries:
|
self._entry_id
|
||||||
self._attr_device_info = DeviceInfo(
|
):
|
||||||
identifiers=device.identifiers,
|
self._attr_device_info = DeviceInfo(
|
||||||
manufacturer=device.manufacturer,
|
identifiers=device.identifiers,
|
||||||
model=device.model,
|
manufacturer=device.manufacturer,
|
||||||
name=device.name,
|
model=device.model,
|
||||||
sw_version=device.sw_version,
|
name=device.name,
|
||||||
)
|
sw_version=device.sw_version,
|
||||||
break
|
)
|
||||||
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
_sw_version = status["system-version"]
|
_sw_version = status["system-version"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue