Remove unnecessary dict lookup in fibaro integration (#101885)

pull/101907/head
rappenze 2023-10-12 19:51:43 +02:00 committed by GitHub
parent a92919b8fd
commit 85af452c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -227,11 +227,8 @@ class FibaroController:
def get_siblings(self, device: DeviceModel) -> list[DeviceModel]:
"""Get the siblings of a device."""
if device.has_endpoint_id:
return self.get_children2(
self._device_map[device.fibaro_id].parent_fibaro_id,
self._device_map[device.fibaro_id].endpoint_id,
)
return self.get_children(self._device_map[device.fibaro_id].parent_fibaro_id)
return self.get_children2(device.parent_fibaro_id, device.endpoint_id)
return self.get_children(device.parent_fibaro_id)
@staticmethod
def _map_device_to_platform(device: DeviceModel) -> Platform | None: